2022 Method
Changes 0
M

ViewSection.CreateReferenceSection

Description:
Creates a new reference section.
Remarks:
The reference section will assume the ViewFamilyType of the view it references.
public static void CreateReferenceSection(
	Document document,
	ElementId parentViewId,
	ElementId viewIdToReference,
	XYZ headPoint,
	XYZ tailPoint
)
  • document
    The document to which the reference section will be added.
  • parentViewId
    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
    Detail, Drafting and Section views can be referenced. The ViewFamilyType of the referenced view will be used by the new reference section.
  • headPoint
    Determines the location of the section marker's head in the parent view.
  • tailPoint
    Determines the location of the section marker's tail in the parent view.
  • 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.
  • A non-optional argument was null
  • 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.
  • The document has no open transaction.