ViewSection.CreateReferenceSection
Method
Description:
Creates a new reference section.
Creates a new reference section.
Remarks:
The reference section will assume the ViewFamilyType of the view it references.
The reference section will assume the ViewFamilyType of the view it references.
Syntax
Parameters
Parameter | Type | Description |
---|---|---|
document | Document | The document to which the reference section will be added. |
parentViewId | ElementId | The view in which the new reference section marker will appear. Reference sections can be created in FloorPlan, CeilingPlan, StructuralPlan, Section, Elevation, Drafting, and Detail views. |
viewIdToReference | ElementId | Detail, Drafting and Section views can be referenced. The ViewFamilyType of the referenced view will be used by the new reference section. |
headPoint | XYZ | Determines the location of the section marker's head in the parent view. |
tailPoint | XYZ | Determines the location of the section marker's tail in the parent view. |
Return Value
Exceptions
Exception | Condition |
---|---|
ArgumentException | The ElementId viewIdToReference does not correspond to a View. -or- The ElementId parentViewId does not correspond to a View. -or- The parent view and the referenced view must be different views. -or- Can't create a new reference sections in parentViewId. Parent views must be FloorPlan, CeilingPlan, StructuralPlan, Section, Elevation, Drafting, or Detail views. -or- The viewIdToReference cannot be referenced by reference sections. Only Detail, Drafting and Section views can be referenced. -or- headPoint and tailPoint do not differ when projected onto a plane perpendicular to the view direction. -or- Reference 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. |