Message 1 of 3
Calculate the ModelItem Bounding Box Directions using Navisworks API
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I am trying to draw a Bounding Box on clicking the Model Item but this is not working properly for oriented model items.
Is there a way to transform the bounding box to correctly display it?
Thanks,
Amitabh
//boundingbox of the current selection
BoundingBox3D boundingBox = clickedModel.BoundingBox();
//Returns the Transform attached to this item in the original source design file
Transform3D modelTransform = clickedModel.Transform;
Point3D origin = boundingBox.Min;
Vector3D xVector = new Vector3D((boundingBox.Max.X - boundingBox.Min.X), 0, 0);
Vector3D yVector = new Vector3D(0, (boundingBox.Max.Y - boundingBox.Min.Y), 0);
Vector3D zVector = new Vector3D(0, 0, (boundingBox.Max.Z - boundingBox.Min.Z));
double X = boundingBox.Max.X - boundingBox.Min.X;
double Y = boundingBox.Max.Y - boundingBox.Min.Y;
double Z = boundingBox.Max.Z - boundingBox.Min.Z;
//draw a cuboid
graphics.Cuboid(origin, xVector, yVector, zVector, false);