Community
Hi,
Does anyone know how to export to a txt file a list containg all the objects on the current layer and their properties?
To be precise, I would like to export the following items from a selection of plines:
- ObjectID;
- Start Point;
- End Point;
- Vertex Points;
- Width.
Thanks in advance.
Solved! Go to Solution.
Solved by Lee_Mac. Go to Solution.
Quickly written, untested:
;; ExportPline - Lee Mac - www.lee-mac.com (defun c:ExportPline ( / f i o s ) (if (and (setq s (ssget '((0 . "LWPOLYLINE")))) (setq f (getfiled "Create Output File" "" "txt" 1)) (setq f (open f "w")) ) (progn (repeat (setq i (sslength s)) (setq o (vlax-ename->vla-object (ssname s (setq i (1- i))))) (write-line (apply 'strcat (vl-list* (itoa (vla-get-objectid o)) "\t" (rtos (vla-get-constantwidth o)) "\t" ( (lambda ( a ) (a (vlax-get o 'coordinates))) (lambda ( b ) (if b (cons (strcat (rtos (car b)) "," (rtos (cadr b)) "\t") (a (cddr b)) ) ) ) ) ) ) f ) ) (close f) ) ) (princ) ) (vl-load-com) (princ)