Creates a new instance of conduit.
Namespace: Autodesk.Revit.DB.ElectricalAssembly: RevitAPI (in RevitAPI.dll) Version: 25.0.0.0 (25.0.0.0)
Syntaxpublic static Conduit Create(
Document document,
ElementId conduitType,
XYZ startPoint,
XYZ endPoint,
ElementId levelId
)
Public Shared Function Create (
document As Document,
conduitType As ElementId,
startPoint As XYZ,
endPoint As XYZ,
levelId As ElementId
) As Conduit
public:
static Conduit^ Create(
Document^ document,
ElementId^ conduitType,
XYZ^ startPoint,
XYZ^ endPoint,
ElementId^ levelId
)
static member Create :
document : Document *
conduitType : ElementId *
startPoint : XYZ *
endPoint : XYZ *
levelId : ElementId -> Conduit
Parameters
- document Document
-
The document.
- conduitType 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 XYZ
-
The start point of the conduit location line.
- endPoint XYZ
-
The end point of the conduit location line.
- levelId 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
Conduit
The newly created conduit.
ExceptionsException | Condition |
---|
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.
|
ArgumentNullException |
A non-optional argument was null
|
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).
|
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.
|
Remarks
This method will regenerate the document.
See Also