Returns a new section ViewSection.
Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 26.1.0.0 (26.1.0.34)
Syntax
C#
public static ViewSection CreateSection( Document document, ElementId viewFamilyTypeId, BoundingBoxXYZ sectionBox )
Parameters
- document Document
- The document to which the new section ViewSection will be added.
- viewFamilyTypeId ElementId
- The id of the ViewFamilyType which will be used by the new section ViewSection. The type needs to be a Section ViewFamily.
- sectionBox BoundingBoxXYZ
- The BoundingBoxXYZ which specifies the new ViewSection's view direction and extents.
Return Value
ViewSectionThe new section ViewSection.
Exceptions
Exception | Condition |
---|---|
ArgumentException | The ViewFamilyType must be a Section ViewFamily. -or- The BoundingBoxXYZ is not appropriate for detail views. The basis vectors of must be unit length and orthonormal. The near and far bound offsets cannot be reversed or too close to each other. MinEnabled and MaxEnabled must be set to true for all three directions. -or- Section view creation is not allowed in this family. |
ArgumentNullException | A non-optional argument was null |
ModificationForbiddenException | The document is in failure mode: an operation has failed, and Revit requires the user to either cancel the operation or fix the problem (usually by deleting certain elements). -or- The document is being loaded, or is in the midst of another sensitive process. |
ModificationOutsideTransactionException | The document has no open transaction. |