Creates a new instance of cable tray.
Namespace: Autodesk.Revit.DB.Electrical
Assembly: RevitAPI (in RevitAPI.dll) Version: 2015.0.0.0 (2015.0.0.0)
Syntax
C# |
---|
|
Visual Basic |
---|
|
Visual C++ |
---|
|
Parameters
- document
- Type: Autodesk.Revit.DB Document
The document.
- cabletrayType
- Type: Autodesk.Revit.DB ElementId
The cable tray type. This must be a cable tray type accepted by isValidCableTrayType(). If the input cable tray type is InvalidElementId, the default cable tray type from the document will be used.
- startPoint
- Type: Autodesk.Revit.DB XYZ
The start point of the cable tray location line.
- endPoint
- Type: Autodesk.Revit.DB XYZ
The end point of the cable tray location line.
- levelId
- Type: Autodesk.Revit.DB ElementId
The element id of the level which this cable tray based. If the input level id is invalidElementId = -1, the nearest level will be used.
Return Value
The newly created cable tray.Remarks
This method will regenerate the document.
Exceptions
Exception | Condition |
---|---|
Autodesk.Revit.Exceptions ArgumentException | This cable tray type is invalid. -or- This level id is invalid. -or- This two end points are invalid. |
Autodesk.Revit.Exceptions ArgumentNullException | A non-optional argument was NULL |
Autodesk.Revit.Exceptions DisabledDisciplineException | None of the following disciplines is enabled: Mechanical Electrical Piping. |
Autodesk.Revit.Exceptions InvalidOperationException | 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). |
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. |