我是应塔格拉斯的要求做这件事的,但我相信这可以扩展到更多的选择。
李 完美,一如既往。。。。
非常感谢Lee Mac 太好了,很高兴你喜欢
有一个例程可以从、块或文本导出插入点。。。
是别人要的。。我正在寻找那个线索。。。
http://www.petrkonecny.eu/autolisp
xyzout。lsp 尊敬的李:,
您是否可以更改此例程,在多段线之间放置一条空行或更好的任何标记?一、 我需要知道一个在哪里结束,下一个在哪里开始。那真的很有帮助。
谢谢
乔齐 快速重写。。。
(defun c:test ( / _lst->str el en fn fo i pt ss zv ) ;; © Lee Mac 2011
(defun _lst->str ( lst del )
(if (cdr lst)
(strcat (car lst) del (_lst->str (cdr lst) del))
(car lst)
)
)
(if
(and
(setq ss (ssget '((0 . "*POLYLINE"))))
(setq fn (getfiled "Output File" "" "csv,txt" 1))
(setq fo (open fn "w"))
)
(progn
(repeat (setq i (sslength ss))
(setq en (ssname ss (setq i (1- i)))
el (entget en)
)
(cond
( (eq "LWPOLYLINE" (cdr (assoc 0 el)))
(setq zv (list (cdr (assoc 38 el))))
(while (setq pt (assoc 10 el))
(write-line (_lst->str (mapcar 'rtos (append (cdr pt) zv)) ",") fo)
(setq el (cdr (member pt el)))
)
)
( t
(while (eq "VERTEX" (cdr (assoc 0 (setq el (entget (setq en (entnext en)))))))
(write-line (_lst->str (mapcar 'rtos (cdr (assoc 10 el))) ",") fo)
)
)
)
(write-line "" fo)
)
(setq fo (close fo)) (startapp "notepad" fn)
)
)
(princ)
) 非常感谢李,这是一个梦想般的工作。
现在有一个不同的挑战:
不导出XYZ坐标,您可以将其转换为十进制坐标吗?
我知道这是一个完全不同的问题。在civil 3d中,有一个大地测量计算器,可以一个接一个地进行计算,但这对数千个点不起作用。
我的绘图区域是南非共和国。
坐标
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. 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 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?
;; 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)
页:
1
[2]