Jump to content

Total Length of 3d object like pipes and other linear steel material.


Recommended Posts

Hello Everyone, 

I have a 3D model of a steel stair consisting of three different types of stairs. My goal is to obtain the cutting length for each part of the stairs, which I have completed. However, this process takes a considerable amount of time since I need to orient each specific part to obtain the precise cutting length using linear dimensioning. This is necessary because using the DI command is not accurate when the object is on a slope or has an unusual cut. I am hoping to  a LISP that could provide me with the total length of the 3D object, including pipes, SHS, RHS, and angle bars, even if they are positioned on a slope. A line that represents the real cutting length, a prompt, or a value in the command line would be perfect. I hope you understand what I mean and can help me. Thank you.








Link to comment
Share on other sites

If the pieces can be laid out in the world UCS XY plane does a bounding box give correct answer for length and width. 


(setq obj (vlax-ename->vla-object (car (entsel "pick object "))))

(vla-GetBoundingBox obj 'minpoint 'maxpoint)
(setq pointmin (vlax-safearray->list minpoint))
(setq pointmax (vlax-safearray->list maxpoint))

;minpoint contains the minimum point of the bounding box
;maxpoint contains the maximum point of the bounding box


What does Massprop reveal ?

Link to comment
Share on other sites

the rectangular steel is pretty easy, you can entget the solid

get the vertexes from the decoded SAT http://www.theswamp.org/index.php?topic=25097.msg302271#msg302271


The pipe is a little harder, you may be able to get an edge (cylinders have two end vertexes)  use the edge, or vertexes to align with the UCS/WCS,

then get the bounding box as BIGAL suggests.


You can get better results from C# using Brep, one hiccup is if the material is grained opposite the length, then your kinda screwed 


for grained material,  you can attach a direction vector as xdata, some xdata codes are transformed as you rotate the objects. then you can use that

xdata to build a matrix so vla-GetBoundingBox can be used.


There's C# code at theswamp where I've played with this before


Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...