- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi everyone!
I have this routine from kimprojects, that sum up length of polylines and label as a text. Works very good but i need to change the units from meters to centimeters and i couldn't do it so far. Any helps?
(defun c:LPL (/ e ss l p i)
(if
(setq l 0.0 ss (ssget '((0 . "LINE,SPLINE,LWPOLYLINE,POLYLINE,ARC,CIRCLE,ELLIPSE"))))
(progn
(repeat (setq i (sslength ss))
(setq e (ssname ss (setq i (1- i)))
l (+ l (vlax-curve-getDistAtParam e (vlax-curve-getEndParam e)))
)
)
(if
(setq p (getpoint "\nSpecify a point to insert text: "))
(entmake
(list
'(0 . "TEXT")
'(100 . "AcDbText")
(cons 10 (trans p 1 0))
(cons 40 (/ 0.2 (getvar 'cannoscalevalue)))
(cons 1 (rtos l))
)
)
(princ (strcat "\nTotal length = " (rtos l)))
)
)
)
(princ)
)
Solved! Go to Solution.