Creates a new reference section.
Namespace: Autodesk.Revit.DBAssembly: RevitAPI (in RevitAPI.dll) Version: 23.0.0.0 (23.1.0.0)
Since: 2013
Syntax
C# |
---|
public static void CreateReferenceSection( Document document, ElementId parentViewId, ElementId viewIdToReference, XYZ headPoint, XYZ tailPoint ) |
Visual Basic |
---|
Public Shared Sub CreateReferenceSection ( _ document As Document, _ parentViewId As ElementId, _ viewIdToReference As ElementId, _ headPoint As XYZ, _ tailPoint As XYZ _ ) |
Visual C++ |
---|
public: static void CreateReferenceSection( Document^ document, ElementId^ parentViewId, ElementId^ viewIdToReference, XYZ^ headPoint, XYZ^ tailPoint ) |
Parameters
- document
- Type: Autodesk.Revit.DB..::..Document
The document to which the reference section will be added.
- parentViewId
- Type: Autodesk.Revit.DB..::..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
- Type: Autodesk.Revit.DB..::..ElementId
Detail, Drafting and Section views can be referenced. The ViewFamilyType of the referenced view will be used by the new reference section.
- headPoint
- Type: Autodesk.Revit.DB..::..XYZ
Determines the location of the section marker's head in the parent view.
- tailPoint
- Type: Autodesk.Revit.DB..::..XYZ
Determines the location of the section marker's tail in the parent view.
Remarks
The reference section will assume the ViewFamilyType of the view it references.
Exceptions
Exception | Condition |
---|---|
Autodesk.Revit.Exceptions..::..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. |
Autodesk.Revit.Exceptions..::..ArgumentNullException | A non-optional argument was null |
Autodesk.Revit.Exceptions..::..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. |
Autodesk.Revit.Exceptions..::..ModificationOutsideTransactionException | The document has no open transaction. |