Bounding |
The BoundingBoxXYZ type exposes the following members.
Name | Description | |
---|---|---|
![]() | BoundingBoxXYZ | Constructs a new BoundingBoxXYZ with a default transform and extents of (-100, -100, -100) to (100, 100, 100). |
Name | Description | |
---|---|---|
![]() | BoundEnabled | Indexed access for loops. |
![]() | Bounds | Indexed access for loops. Use 0 for Min and 1 for Max. |
![]() | Enabled | Defines whether the entire bounding box is enabled. |
![]() ![]() | IsReadOnly | Identifies if the object is read-only or modifiable. (Inherited from APIObject) |
![]() | IsSet | Indicates whether the bounding box is set. |
![]() | Max | Maximum coordinates (upper-right-front corner of the box). |
![]() | MaxEnabled | Defines whether the maximum bound is active for given dimension. |
![]() | Min | Minimum coordinates (lower-left-rear corner of the box). |
![]() | MinEnabled | Defines whether the minimum bound is active for given dimension. |
![]() ![]() | Transform | The transform from the coordinate space of the box to the model coordinate space. |
Name | Description | |
---|---|---|
![]() | Dispose | Causes the object to release immediately any resources it may be utilizing. (Inherited from APIObject) |
![]() | Equals | Determines whether the specified object is equal to the current object. (Inherited from Object) |
![]() | GetHashCode | Serves as the default hash function. (Inherited from Object) |
![]() | GetType | Gets the Type of the current instance. (Inherited from Object) |
![]() | ToString | Returns a string that represents the current object. (Inherited from Object) |
BoundingBoxXYZ objects are used in Revit in several places related to views (for example, the section box of a 3D view or the definition of a section or detail view). BoundingBoxXYZ objects can also be obtained from elements representing the boundary of the element in a given view.
The extents of the box are determined by three orthogonal planes extended through the minimum (Min) and maximum (Max) points, but the coordinates of these points and the orientation of the planes in relation to the coordinates of the source model is determined by the box Transform (Transform).
This class also has the ability to detect and mark certain extents as disabled. Note that in the current Revit API uses of this class it is not expected that Revit will give objects with disabled extents, and disabled extents in objects sent to Revit will likely be ignored.
public void GetBoundingBoxXYZInfo(View3D view3D) { string message = "BoundingBoxXYZ : "; message += "\nView name : " + view3D.Name; BoundingBoxXYZ boundingBox = view3D.GetSectionBox(); // The section box of the 3D view can cut the model. if (view3D.IsSectionBoxActive) { BoundingBoxXYZ sectionBox = view3D.GetSectionBox(); // Note that the section box can be rotated and transformed. // So the min/max corners coordinates relative to the model must be computed via the transform. Transform trf = sectionBox.Transform; XYZ max = sectionBox.Max; //Maximum coordinates (upper-right-front corner of the box before transform is applied). XYZ min = sectionBox.Min; //Minimum coordinates (lower-left-rear corner of the box before transform is applied). // Transform the min and max to model coordinates XYZ maxInModelCoords = trf.OfPoint(max); XYZ minInModelCoords = trf.OfPoint(min); message += "\nView has an active section box: "; message += "\n'Maximum' coordinates: " + maxInModelCoords; message += "\n'Minimum' coordinates: " + minInModelCoords; } TaskDialog.Show("Revit", message); }