I have a number of extruded circles in a model. I have to calculate the toltal length of these entities, but I can seem to figure out an efficient way of doing this. I found the lisp posted below, and it works fine for a single object. Is there a way to select multiple entities with lisp and calculate the extrusion height? Thanks for any info on this.
Solved! Go to Solution.
Solved by hmsilva. Go to Solution.
Untested
(vl-load-com) (defun c:demo (/ i l tl ss) (if (setq ss (ssget '((0 . "3DSOLID")))) (repeat (setq i (sslength ss)) (setq l (getpropertyvalue (ssname ss (setq i (1- i))) "Height") tl (if tl (+ tl l) l ) ) ) ) (princ tl) (princ) )
Hope this helps,
Henrique
That works great. Is there a setting that I can add to it to have the measurements read out in engineering units instead of decimal?
I' a metric guy,
try
(vl-load-com) (defun c:demo (/ i l tl ss) (if (setq ss (ssget '((0 . "3DSOLID")))) (repeat (setq i (sslength ss)) (setq l (getpropertyvalue (ssname ss (setq i (1- i))) "Height") tl (if tl (+ tl l) l ) ) ) ) (if tl (princ (strcat "\nTotal Heigth = " (rtos tl 3 2))) ) (princ) )
Hope this helps,
Henrique
Can't find what you're looking for? Ask the community or share your knowledge.