RVTDocs.com
Namespace: Autodesk.Revit.DB Class: View3D

View3D.SetSectionBox

Method
Description:
Sets the section box for this 3D view.
Syntax
public void SetSectionBox(
	BoundingBoxXYZ boundingBoxXYZ
)
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);
}
Parameters
Parameter Type Description
boundingBoxXYZ BoundingBoxXYZ The bounding box to use for the section box. To turn off the section box, set <a href="177a4ab8-b7cb-0b3f-3672-64b78246d851.htm">IsSectionBoxActive</a> to false. Individual bound enabled flags in the input box are ignored.
Return Value
Exceptions
Exception Condition
ArgumentException Bounding box cannot be empty.
ArgumentNullException A non-optional argument was null
InvalidOperationException Returns true if the view is not a view template.