View |
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. |
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); }