HI
TRY
POLYLINE DXF Group code 70
;;;==================================================
(vl-load-com) ; initialization
(defun getcoords ( en / coordslst )
(setq coordslst (list))
(setq enlst (entget en))
(foreach x enlst
(if (= (car x) 10)
(setq coordslst (append coordslst (list (cdr x))))
) ; end if
) ; end foreach
coordslst
)
;;;==================================================
(defun c:coolist (/ xml file)
(setq fname "D:/coo.xml")
(setq file (open fname "w"))
(cgpolydesc)
(close file)
(startapp "notepad.exe" fname)
) ;_ end of defun
;;;==================================================
(defun cgpolydesc (/ lst ss i en obj)
(and (setq ss (ssget "X"
'((0 . "LWPOLYLINE") ; object Name
(-4 . "&=") ; bit coded
(70 . 1) ; polylines are OPEN OR CLOSED
)
)
)
(repeat (setq i (sslength ss))
(setq en (ssname ss (setq i (1- i)))
obj (vlax-ename->vla-object en)
)
;----
(setq lst (getcoords en))
(setq idx 0)
(setq xy "")
(repeat (length lst)
(setq xy (strcat xy (rtos (cadr (nth idx lst)) 2 8) "," (rtos (car (nth idx lst)) 2 8) " "))
(setq idx (+ 1 idx))
)
(write-line (strcat (vl-string-trim ", " xy)) file)
;----
)
)
) ;_ end of defun 'cgpolydesc'
;;;==================================================