Creates a new ViewPlan.
Namespace: Autodesk.Revit.DBAssembly: RevitAPI (in RevitAPI.dll) Version: 25.0.0.0 (25.0.0.0)
Syntaxpublic static ViewPlan Create(
Document document,
ElementId viewFamilyTypeId,
ElementId levelId
)
Public Shared Function Create (
document As Document,
viewFamilyTypeId As ElementId,
levelId As ElementId
) As ViewPlan
public:
static ViewPlan^ Create(
Document^ document,
ElementId^ viewFamilyTypeId,
ElementId^ levelId
)
static member Create :
document : Document *
viewFamilyTypeId : ElementId *
levelId : ElementId -> ViewPlan
Parameters
- document Document
-
The document to which the ViewPlan will be added.
- viewFamilyTypeId ElementId
-
The id of the ViewFamilyType which will be used by the new ViewPlan. The type needs to be a FloorPlan, CeilingPlan, AreaPlan, or StructuralPlan ViewType.
- levelId ElementId
-
The id of the Level to associate with the new plan view.
Return Value
ViewPlan
The new ViewPlan.
ExceptionsException | Condition |
---|
ArgumentException |
This view family type is not a plan view type.
-or-
The ElementId levelId does not correspond to a Level.
-or-
StructuralPlans can only be created when the structural discipline is enabled whereas FloorPlans and CeilingPlans can
only be created when architecture or MEP disciplines are enabled.
-or-
Plan 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.
|
Example
double elevation = 10.0;
Level level1 = Level.Create(document, elevation);
ViewPlan floorView = ViewPlan.Create(document, floorPlanId, level1.Id);
elevation += 10.0;
Level level2 = Level.Create(document, elevation);
ViewPlan ceilingView = ViewPlan.Create(document, ceilingPlanId, level2.Id);
Dim elevation As Double = 10.0
Dim level1 As Level = Level.Create(document, elevation)
Dim floorView As ViewPlan = ViewPlan.Create(document, floorPlanId, level1.Id)
elevation += 10.0
Dim level2 As Level = Level.Create(document, elevation)
Dim ceilingView As ViewPlan = ViewPlan.Create(document, ceilingPlanId, level2.Id)
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
See Also