VERYCIVILDRAFTER
04-05-2005, 05:32 PM
A little back ground story for ya.
I needed a lsp that would sum multiple object lengths. I downloaded Hendi's SUMMIT.VLX (thank you very much Hendi) but I need to select almost 300 objects. Anyway, I found this LL.lsp program but it returns an architectural measurement as an answer (as you'll notice my name states I work in civil). I know how to do the x12 math conversion, but if someone could modify the lsp for me to return a plain vanilla unit measurement this lsp would be much more useful to me.
(defun c:ll (/ sset num llen)
(setq sset (ssget '((0 . "LINE,LWPOLYLINE")))
num 0
llen 0
)
(if sset
(progn
(repeat (sslength sset)
(setq llen
(+ llen
(vla-get-length (vlax-ename->vla-object (ssname sset num)))
)
)
(setq num (1+ num))
)
(setq num (rtos num 2 0)
llen (rtos llen 4)
)
(alert (strcat num " line lengths = " llen))
)
)
)
I needed a lsp that would sum multiple object lengths. I downloaded Hendi's SUMMIT.VLX (thank you very much Hendi) but I need to select almost 300 objects. Anyway, I found this LL.lsp program but it returns an architectural measurement as an answer (as you'll notice my name states I work in civil). I know how to do the x12 math conversion, but if someone could modify the lsp for me to return a plain vanilla unit measurement this lsp would be much more useful to me.
(defun c:ll (/ sset num llen)
(setq sset (ssget '((0 . "LINE,LWPOLYLINE")))
num 0
llen 0
)
(if sset
(progn
(repeat (sslength sset)
(setq llen
(+ llen
(vla-get-length (vlax-ename->vla-object (ssname sset num)))
)
)
(setq num (1+ num))
)
(setq num (rtos num 2 0)
llen (rtos llen 4)
)
(alert (strcat num " line lengths = " llen))
)
)
)