Sets the section box for this 3D view.
Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 16.0.0.0 (16.0.0.0)
Syntax
C# |
---|
|
Visual Basic |
---|
|
Visual C++ |
---|
|
Parameters
- boundingBoxXYZ
- Type: Autodesk.Revit.DB BoundingBoxXYZ
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.Exceptions ArgumentException | Bounding box cannot be empty. |
Autodesk.Revit.Exceptions ArgumentNullException | A non-optional argument was NULL |
Autodesk.Revit.Exceptions InvalidOperationException | View cannot be a template view. |