Community
AutoCAD Forum
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Calculate Extrusion height

5 REPLIES 5
SOLVED
Reply
Message 1 of 6
CSM_MAI
681 Views, 5 Replies

Calculate Extrusion height

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.

 

http://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/extrusion-height-of-a-3d-solid-in-aut...

 

 

5 REPLIES 5
Message 2 of 6
hmsilva
in reply to: CSM_MAI

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

EESignature

Message 3 of 6
CSM_MAI
in reply to: hmsilva

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?

Message 4 of 6
hmsilva
in reply to: CSM_MAI

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

EESignature

Message 5 of 6
CSM_MAI
in reply to: hmsilva

Perfect. Thanks again for the quick response. I appreciate it.

Message 6 of 6
hmsilva
in reply to: CSM_MAI


@CSM_MAI wrote:

Perfect. Thanks again for the quick response. I appreciate it.


You're welcome, CSM_WP
Glad I could help

Henrique

EESignature

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Technology Administrators


Autodesk Design & Make Report