This is help for you.
(vl-load-com)
(defun _pac (e / l v d lst)
(setq d (- (setq v (/ (setq l (vlax-curve-getDistAtParam e (vlax-curve-getEndParam e))) 100.))))
(while (< (setq d (+ d v)) l)
(setq lst (cons (vlax-curve-getPointAtDist e d) lst))
)
)
(defun c:dd (/ s i e p r n x lss t1 t2)
(setq p 0)
(= 1 (getvar 'Dwgtitled))
(setq collectedData nil
csvFile (strcat (getvar 'dwgprefix) (vl-filename-base (getvar 'dwgname)) ".csv")
)
(if (setq s (ssget "_:L" '((0 . "POLYLINE,LWPOLYLINE") (-4 . "<OR") (70 . 1) (70 . 3)(-4 . "OR>"))))
(repeat
(setq i (sslength s))
(setq e (ssname s (setq i (1- i))))
(setq r (getpropertyvalue e "area"))
(setq t2 (strcat "AREA" "," (rtos r 2 1)))
(foreach itm (setq ptlist (mapcar 'cdr (vl-remove-if-not '(lambda (x) (= (car x) 10)) (entget e))))
(setq p (1+ p))
(princ "\n") (princ (setq coor (strcat (rtos p 2 0) "," (rtos (car itm) 2 3) "," (rtos (car itm) 2 3))))
(setq x (cons (list coor) x))
)
(foreach lk x (setq lss (cons lk lss)))
(if (setq ss (ssget "_WP" (_pac e) (list '(0 . "TEXT,MTEXT") )))
(repeat
(setq n (sslength ss))
(setq hnd (ssname ss (setq n (1- n))))
(setq vobject (vlax-ename->vla-object hnd))
(if (vlax-property-available-p vobject 'textstring); test if object has textstring property
(setq vobjstring (vla-get-textstring vobject)) ; String value
(princ "\nSelected object don't have \"TextString\" property... ")
); if
(setq t1 (strcat "ID" "," vobjstring))
)
)
(setq lss (cons (list t2) lss))
(setq lss (cons (list t1) lss))
(setq p 0 x nil)
);repeat
);if main
(setq opf (open csvFile "w"))
(foreach rowValue lss
(write-line (apply 'strcat rowValue) opf)
)
(setq lss nil)
(not (close opf))
(princ)
)
I am not a lisp expert ..
Pline area to csv.lsp