StairsRun.CreateStraightRun
Method
Description:
Creates a straight run in the project document.
Creates a straight run in the project document.
Remarks:
The new stairs run and the document will be regenerated. This should be run from within an open transaction.
The new stairs run and the document will be regenerated. This should be run from within an open transaction.
Syntax
public static StairsRun CreateStraightRun(
Document document,
ElementId stairsId,
Line locationPath,
StairsRunJustification justification
)
Parameters
Parameter | Type | Description |
---|---|---|
document | Document | The document. |
stairsId | ElementId | The stairs that the new stairs run will belong to. |
locationPath | Line | The line for location path of the new stairs run. The line has following restriction: <ul><li>The line should be bound line which is parallel to the XY plane.</li><li>The Z coordinate of the line is the base elevation for the new run (in model coordinates). It must be greater than or equal to the stairs base elevation.</li><li>The number of created risers will be calculated by rounding the length of the location path to a multiple of the tread depth.</li></ul> |
justification | StairsRunJustification | The location path justification of the new stairs run. |
Return Value
Type | Description |
---|---|
StairsRun | The new stairs run. |
Exceptions
Exception | Condition |
---|---|
ArgumentException | The stairsId is not a valid stairs element. -or- The input locationPath is not a bound line. -or- The input locationPath is not a valid location path line for straight run. -or- The locationPath is not valid line used as stairs path(probably it's too short). |
ArgumentNullException | A non-optional argument was null |
ArgumentOutOfRangeException | A value passed for an enumeration argument is not a member of that enumeration |
InvalidOperationException | The stairs element represented by stairsId is not in an active StairsEditScope. New components cannot be added to it. |
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. |
RegenerationFailedException | The locationPath doesn't satisfy restrictions to generate straight run. |