- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello. I have this routine that i'm trying to adapt to my necessities. I need to add a prefix (L=) and suffix (cm) so that the result shows "L=100 cm". I don't understand where i have to add it. i tried (cons 1 "L=" (rtos l 2 0)) "cm") bur it doesn't work.
I appreciate your help. The lisp:
(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)))
)
)
(setq l (* 100 l))
(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.15 (getvar 'cannoscalevalue)))
(cons 1 (rtos l 2 0))
)
)
(princ (strcat "\nTotal length = " (rtos l 2 0)
)
(princ)
)
Solved! Go to Solution.