Set Z starting point to 0 for complex 3d solid

Set Z starting point to 0 for complex 3d solid

Anonymous
Not applicable
1,261 Views
5 Replies
Message 1 of 6

Set Z starting point to 0 for complex 3d solid

Anonymous
Not applicable

Hello everyone,

I am facing a tricky problem. A drawing contains many 3d solids with horizontal bottom faces which should have z coordinate exactly 0, but some 3d solids are not exactly at 0 and have different z coordinates between them. I am looking for a way to fix it, and I found the solution to select 3d solids and change in property management palette the z starting point to 0. And it works... with only type box 3d solids. My problem is my 3d solids are made with "EXTRUDE" and some were unit with "UNION". They are complex and the z starting point in property management palette is not available for them.

 

Do you have an idea of how I can change the z starting point to 0 for complex 3d solids ?

0 Likes
1,262 Views
5 Replies
Replies (5)
Message 2 of 6

Alfred.NESWADBA
Consultant
Consultant

Hi,

 

>> They are complex and the z starting point in property

>> management palette is not available for them.

The problem here is that "complex" 3D-Solid objects don't have a defined start-point.

The only chance I see to do that automatically is to write a small tool which get's the extents of the objects and so can evaluate the lower z-value from the extents ... to then move the object by the difference.

 

If it's just one drawing ==> upload it, maybe someone does it for you.

 

- alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
ISH-Solutions GmbH / Ingenieur Studio HOLLAUS
www.ish-solutions.at ... blog.ish-solutions.at ... LinkedIn ... CDay 2026
------------------------------------------------------------------------------------

(not an Autodesk consultant)
0 Likes
Message 3 of 6

Anonymous
Not applicable

Thank you for your answer Alfred.

>> the only chance I see to do that automatically is to write a small tool

Which kind of small tool, a script ? Can you link a page where I can learn about that ? I would like to do it myself.

0 Likes
Message 4 of 6

Alfred.NESWADBA
Consultant
Consultant

Hi,

 

>> Which kind of small tool, a script ?

No, a script is just a list of commands, but no calculations based on object properties like go through all objects by a specific type, get the lowest z from extents of an object and move that object by the difference to Z=0.

 

You can use a lot of development tools in AutoCAD, most famous for AutoCAD is LISP, but also C#, VB.NET, VBA, C++ (ObjectARX) is available. Forums for customization's can be found >>>here<<<

 

Good luck, - alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
ISH-Solutions GmbH / Ingenieur Studio HOLLAUS
www.ish-solutions.at ... blog.ish-solutions.at ... LinkedIn ... CDay 2026
------------------------------------------------------------------------------------

(not an Autodesk consultant)
0 Likes
Message 5 of 6

Anonymous
Not applicable

Thank you Alfred,

I will try to create it. I let the topic without accepted solution in order that someone else answer or until I post the tool.

0 Likes
Message 6 of 6

doaiena
Collaborator
Collaborator

Does this solve your problem?

(defun c:test ( / ss ctr obj minPoint maxPoint pt1)

(if (setq ss (ssget '((0 . "3DSOLID"))))
(progn

(setq ctr 0)
(repeat (sslength ss)
(setq obj (vlax-ename->vla-object (ssname ss ctr)))

(vla-getboundingbox obj 'minPoint 'maxPoint)
(setq pt1 (vlax-safearray->list minPoint))

(if (not (equal (caddr pt1) 0 1e-8))
(vla-move obj (vlax-3d-point pt1) (vlax-3d-point (list (car pt1) (cadr pt1) 0)))
)

(setq ctr (1+ ctr))
);repeat

));if ss

(princ)
);defun 
0 Likes