Sets the section box for this 3D view.
Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 24.0.0.0 (24.0.0.0)
Syntax
C# |
---|
|
Visual Basic |
---|
|
Visual C++ |
---|
|
Parameters
- boundingBoxXYZ
- Type: Autodesk.Revit.DBBoundingBoxXYZ
The bounding box to use for the section box. To turn off the section box, set IsSectionBoxActive to false. Individual bound enabled flags in the input box are ignored.
Examples

private void ExpandSectionBox(View3D view)
{
// The original section box
BoundingBoxXYZ sectionBox = view.GetSectionBox();
// Expand the section box (doubling in size in all directions while preserving the same center and orientation)
Autodesk.Revit.DB.XYZ deltaXYZ = sectionBox.Max - sectionBox.Min;
sectionBox.Max += deltaXYZ / 2;
sectionBox.Min -= deltaXYZ / 2;
//After resetting the section box, it will be shown in the view.
//It only works when the Section Box is active
view.SetSectionBox(sectionBox);
}
Exceptions
Exception | Condition |
---|---|
Autodesk.Revit.ExceptionsArgumentException | Bounding box cannot be empty. |
Autodesk.Revit.ExceptionsArgumentNullException | A non-optional argument was null |
Autodesk.Revit.ExceptionsInvalidOperationException | Returns true if the view is not a view template. |