Creates a new instance of conduit.
Namespace: Autodesk.Revit.DB.ElectricalAssembly: RevitAPI (in RevitAPI.dll) Version: 21.0.0.0 (21.1.1.109)
Syntax
C# |
---|
public static Conduit Create( Document document, ElementId conduitType, XYZ startPoint, XYZ endPoint, ElementId levelId ) |
Visual Basic |
---|
Public Shared Function Create ( _ document As Document, _ conduitType As ElementId, _ startPoint As XYZ, _ endPoint As XYZ, _ levelId As ElementId _ ) As Conduit |
Visual C++ |
---|
public: static Conduit^ Create( Document^ document, ElementId^ conduitType, XYZ^ startPoint, XYZ^ endPoint, ElementId^ levelId ) |
Parameters
- document
- Type: Autodesk.Revit.DB..::..Document
The document.
- conduitType
- Type: Autodesk.Revit.DB..::..ElementId
The conduit type. This must be a conduit type accepted by isValidConduitType(). If the input conduit type is InvalidElementId, the default conduit type from the document will be used.
- startPoint
- Type: Autodesk.Revit.DB..::..XYZ
The start point of the conduit location line.
- endPoint
- Type: Autodesk.Revit.DB..::..XYZ
The end point of the conduit location line.
- levelId
- Type: Autodesk.Revit.DB..::..ElementId
The element id of the level which this conduit based. If the input level id is invalidElementId = -1, the nearest level will be used.
Return Value
The newly created conduit.
Remarks
This method will regenerate the document.
Exceptions
Exception | Condition |
---|---|
Autodesk.Revit.Exceptions..::..ArgumentException | This conduit type is invalid. -or- This level id is invalid. -or- The points of startPoint and endPoint are too close: for MEPCurve, the minimum length is 1/10 inch. |
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. |