Revit 2017.1 API |
Railing..::..Create Method (Document, CurveLoop, ElementId, ElementId) |
Railing Class See Also |
Creates a new railing by specifying the railing path in the project document.
Namespace: Autodesk.Revit.DB.Architecture
Assembly: RevitAPI (in RevitAPI.dll) Version: 17.0.0.0 (17.0.1090.0)
Since:
2017
Syntax
C# |
---|
public static Railing Create( Document document, CurveLoop curveLoop, ElementId railingTypeId, ElementId baseLevelId ) |
Visual Basic |
---|
Public Shared Function Create ( _ document As Document, _ curveLoop As CurveLoop, _ railingTypeId As ElementId, _ baseLevelId As ElementId _ ) As Railing |
Visual C++ |
---|
public: static Railing^ Create( Document^ document, CurveLoop^ curveLoop, ElementId^ railingTypeId, ElementId^ baseLevelId ) |
Parameters
- document
- Type: Autodesk.Revit.DB..::..Document
The document.
- curveLoop
- Type: Autodesk.Revit.DB..::..CurveLoop
The railing path which the new railing will be created along with. The curveLoop should be continuous with curves which are only bounded lines and arcs on the same horizontal plane.
- railingTypeId
- Type: Autodesk.Revit.DB..::..ElementId
The railing type of the new railing is to be created.
- baseLevelId
- Type: Autodesk.Revit.DB..::..ElementId
The base level on which the new railing will be created.
Return Value
The new railing instance if creation was successful, otherwise nullNothingnullptra null reference (Nothing in Visual Basic).
Exceptions
Exception | Condition |
---|---|
Autodesk.Revit.Exceptions..::..ArgumentException | curveLoop is empty. -or- curveLoop should only contain lines or arcs. -or- curveLoop is not continuous. -or- Not all curves in curveLoop are on the same horizontal plane. -or- The railingTypeId is not a railing type. -or- The baseLevelId is not a valid level id for a railing. |
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. |