乐筑天下

搜索
欢迎各位开发者和用户入驻本平台 尊重版权,从我做起,拒绝盗版,拒绝倒卖 签到、发布资源、邀请好友注册,可以获得银币 请注意保管好自己的密码,避免账户资金被盗
楼主: cibola

[编程交流] 坐标、块和文本

[复制链接]

114

主题

1万

帖子

1万

银币

中流砥柱

Rank: 25

铜币
543
发表于 2022-7-6 07:32:00 | 显示全部楼层
我没有发现这样的错误。确保已复制框架中的所有代码。
 
我是应塔格拉斯的要求做这件事的,但我相信这可以扩展到更多的选择。
 
回复

使用道具 举报

4

主题

26

帖子

22

银币

初来乍到

Rank: 1

铜币
20
发表于 2022-7-6 07:35:08 | 显示全部楼层
完美,一如既往。。。。
非常感谢Lee Mac
回复

使用道具 举报

114

主题

1万

帖子

1万

银币

中流砥柱

Rank: 25

铜币
543
发表于 2022-7-6 07:40:48 | 显示全部楼层
太好了,很高兴你喜欢
回复

使用道具 举报

29

主题

196

帖子

168

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
145
发表于 2022-7-6 07:41:47 | 显示全部楼层
 
有一个例程可以从、块或文本导出插入点。。。
是别人要的。。我正在寻找那个线索。。。
 
 
http://www.petrkonecny.eu/autolisp
xyzout。lsp
回复

使用道具 举报

35

主题

97

帖子

62

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
175
发表于 2022-7-6 07:46:57 | 显示全部楼层
尊敬的李:,
您是否可以更改此例程,在多段线之间放置一条空行或更好的任何标记?一、 我需要知道一个在哪里结束,下一个在哪里开始。那真的很有帮助。
谢谢
乔齐
回复

使用道具 举报

114

主题

1万

帖子

1万

银币

中流砥柱

Rank: 25

铜币
543
发表于 2022-7-6 07:49:33 | 显示全部楼层
快速重写。。。
 
  1. (defun c:test ( / _lst->str el en fn fo i pt ss zv ) ;; © Lee Mac 2011
  2. (defun _lst->str ( lst del )
  3.    (if (cdr lst)
  4.      (strcat (car lst) del (_lst->str (cdr lst) del))
  5.      (car lst)
  6.    )
  7. )
  8. (if
  9.    (and
  10.      (setq ss (ssget '((0 . "*POLYLINE"))))
  11.      (setq fn (getfiled "Output File" "" "csv,txt" 1))
  12.      (setq fo (open fn "w"))
  13.    )
  14.    (progn
  15.      (repeat (setq i (sslength ss))
  16.        (setq en (ssname ss (setq i (1- i)))
  17.              el (entget en)
  18.        )
  19.        (cond
  20.          ( (eq "LWPOLYLINE" (cdr (assoc 0 el)))
  21.            (setq zv (list (cdr (assoc 38 el))))
  22.            (while (setq pt (assoc 10 el))
  23.              (write-line (_lst->str (mapcar 'rtos (append (cdr pt) zv)) ",") fo)
  24.              (setq el (cdr (member pt el)))
  25.            )
  26.          )
  27.          ( t
  28.            (while (eq "VERTEX" (cdr (assoc 0 (setq el (entget (setq en (entnext en)))))))
  29.              (write-line (_lst->str (mapcar 'rtos (cdr (assoc 10 el))) ",") fo)
  30.            )
  31.          )
  32.        )
  33.        (write-line "" fo)
  34.      )
  35.      (setq fo (close fo)) (startapp "notepad" fn)
  36.    )
  37. )
  38. (princ)
  39. )
回复

使用道具 举报

35

主题

97

帖子

62

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
175
发表于 2022-7-6 07:50:29 | 显示全部楼层
非常感谢李,这是一个梦想般的工作。
 
现在有一个不同的挑战:
不导出XYZ坐标,您可以将其转换为十进制坐标吗?
我知道这是一个完全不同的问题。在civil 3d中,有一个大地测量计算器,可以一个接一个地进行计算,但这对数千个点不起作用。
我的绘图区域是南非共和国。
坐标
回复

使用道具 举报

8

主题

1133

帖子

1164

银币

初来乍到

Rank: 1

铜币
10
发表于 2022-7-6 07:54:32 | 显示全部楼层
 
This is a very complicated calculation, because it transforms Cartesian coordinates on a flat surface to Geographical coordinates on the surface of the Earth. All depending where you are on the Earth, there are different factors to take into the equation.
 
I think this is the wrong place to wish for this, and if you do find a way, you can probably sell it for a lot of money.
 
You should get on to AutoDesk, and get the geodetic calculator to do batch transformations.
回复

使用道具 举报

29

主题

519

帖子

477

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
163
发表于 2022-7-6 07:57:07 | 显示全部楼层
In Civil 3D there's built in functionality that allows you to transform data from one coordinate system into another. But it looks as if Jozi only has vanilla AutoCAD
回复

使用道具 举报

145

主题

590

帖子

446

银币

中流砥柱

Rank: 25

铜币
725
发表于 2022-7-6 08:01:34 | 显示全部楼层
LeeMac,
I am using this routine to save me alot of hard work in reworking points files.  One thing though: it exports to 2 decimal places.  Can this be changed to 3?
 
  1. ;; Polyline Point Exported, by Lee McDonnell 26.07.2009(defun c:ptExp (/ doc spc ss file sel pts) (vl-load-com) (setq doc (vla-get-ActiveDocument             (vlax-get-Acad-Object))       spc (if (zerop (vla-get-activespace doc))             (if (= (vla-get-mspace doc) :vlax-true)               (vla-get-modelspace doc)               (vla-get-paperspace doc))             (vla-get-modelspace doc))) (if (and (setq ss (ssget '((0 . "*POLYLINE"))))          (setq file            (getfiled "Output File"              (if *load *load "") "csv;txt" 9)))   (progn     (setq *load file file (open file "a"))     (vlax-for Obj (setq sel (vla-get-ActiveSelectionSet doc))       (setq pts         (vlax-list->3D-point           (vlax-get Obj 'Coordinates)             (cond ((eq (vla-get-ObjectName Obj) "AcDbPolyline"))) Obj))                 (mapcar         (function           (lambda (x)             (write-line               (strcat                 (rtos (car x) 2 2) (chr 44)                   (rtos (cadr x) 2 2) (chr 44)                     (rtos (caddr x) 2 2)) file)             (vla-addPoint spc (vlax-3D-point x)))) pts))     (princ       (strcat "\n>"))     (close file)     (vla-delete sel))) (princ))       (defun vlax-list->3D-point (lst x Obj / oLst) (while lst   (setq oLst     (cons (list (car lst) (cadr lst)                 (if x (vla-get-Elevation Obj) (caddr lst))) oLst)         lst ((if x cddr cdddr) lst))) oLst)
回复

使用道具 举报

发表回复

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

QQ|关于我们|小黑屋|乐筑天下 繁体中文

GMT+8, 2025-3-10 11:18 , Processed in 0.363482 second(s), 70 queries .

© 2020-2025 乐筑天下

联系客服 关注微信 帮助中心 下载APP 返回顶部 返回列表