ElevationMarker.CreateElevation Method

ElevationMarkerCreateElevation Method

Creates a new elevation ViewSection on the ElevationMarker at the desired index.

Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 25.3.0.0 (25.3.0.0)
Syntax
public ViewSection CreateElevation(
	Document document,
	ElementId viewPlanId,
	int index
)
Public Function CreateElevation ( 
	document As Document,
	viewPlanId As ElementId,
	index As Integer
) As ViewSection
public:
ViewSection^ CreateElevation(
	Document^ document, 
	ElementId^ viewPlanId, 
	int index
)
member CreateElevation : 
        document : Document * 
        viewPlanId : ElementId * 
        index : int -> ViewSection 

Parameters

document  Document
The document to which the new elevation ViewSection will be added.
viewPlanId  ElementId
The id of a ViewPlan in which the ElevationMarker is visible. The new elevation ViewSection will derive its extents and inherit settings from the ViewPlan.
index  Int32
The index on the ElevationMarker where the new elevation ViewSection will be placed. The index on the ElevationMarker must be valid and unused. View direction is determined by the index.

Return Value

ViewSection
The new elevation ViewSection.
Exceptions
ExceptionCondition
ArgumentException The ElementId viewPlanId does not correspond to a ViewPlan. -or- index is occupied or out of range. -or- Elevation view creation is not allowed in this family.
ArgumentNullException A non-optional argument was null
InvalidOperationException Only reference elevations can be hosted on this ElevationMarker.
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.
Remarks
The ViewFamilyType for the new elevation ViewSection is inherited from the ElevationMarker. The new elevation ViewSection will receive a unique view name.
See Also