Entity BoundingBox vs Room BoundingBox

Entity BoundingBox vs Room BoundingBox

colin_magner
Advocate Advocate
1,034 Views
1 Reply
Message 1 of 2

Entity BoundingBox vs Room BoundingBox

colin_magner
Advocate
Advocate
I can get the BoundingBoxXYZ of an entity and set a View3D's section box to equal this, but the result is a section box of the right size in the wrong place. I think it's something to do with the the entities coordinate system being relative to the model and the section box coordinates being relative to the view, but am unsure, and definitely have no idea how to transform them!

I've tried reading the API doc's, but the kind of maths in there related to transformations is alien to me, and there aren't sufficient examples for me to crib from.

When using get_BoundingBox I've tried passing it the View3D and null, neither of which work.

Can anyone offer an example of setting a View3D's section box to the boundingbox of an entity?

Thanks.
0 Likes
1,035 Views
1 Reply
Reply (1)
Message 2 of 2

Joe.Ye
Alumni
Alumni

The boundingBoxXYZ we get from SectionBox is not WCS. It has its own coordinates system. You can get its transform from SectionBox.Transform.

To set a view's sectionBox that fits a given entity. You can get the entity's BoundingBox. Then get its Max and Min point. Then convert this two points to the coordinate system of the 3dview's SectionBox. Finally set the new BoundingBoxXYZ (assigned new Max and Min point) to the SectionBox property.



Joe Ye
Contractor
Developer Technical Services
Autodesk Developer Network
0 Likes