DuctCreate(Document, ElementId, ElementId, Connector, Connector) Method |
Creates a new duct that connects to two connectors.
Namespace: Autodesk.Revit.DB.MechanicalAssembly: RevitAPI (in RevitAPI.dll) Version: 26.0.4.0 (26.0.4.0)
Syntaxpublic static Duct Create(
Document document,
ElementId ductTypeId,
ElementId levelId,
Connector startConnector,
Connector endConnector
)
Public Shared Function Create (
document As Document,
ductTypeId As ElementId,
levelId As ElementId,
startConnector As Connector,
endConnector As Connector
) As Duct
public:
static Duct^ Create(
Document^ document,
ElementId^ ductTypeId,
ElementId^ levelId,
Connector^ startConnector,
Connector^ endConnector
)
static member Create :
document : Document *
ductTypeId : ElementId *
levelId : ElementId *
startConnector : Connector *
endConnector : Connector -> Duct
Parameters
- document Document
-
The document.
- ductTypeId ElementId
-
The ElementId of the new duct type.
- levelId ElementId
-
The level ElementId for the new duct.
- startConnector Connector
-
The first connector where the new duct starts.
- endConnector Connector
-
The second point of the new duct.
Return Value
Duct
The created duct.
ExceptionsException | Condition |
---|
ArgumentException |
The duct type ductTypeId is not valid duct type.
-or-
The ElementId levelId is not a Level.
-or-
The connector's domain is not Domain.​DomainHvac.
-or-
The points of startConnector and endConnector are too close: for MEPCurve, the minimum length is 1/10 inch.
|
ArgumentNullException |
A non-optional argument was null
|
InvalidOperationException |
Thrown when the new duct fails to connect with the connector.
|
Remarks
The new duct will have the same diameter and system type as the start connector. The creation will also connect the new duct
to two component who owns the specified connectors. If necessary, additional fitting(s) are included to make a valid connection.
If the new duct can not be connected to the next component (e.g., mismatched direction, no valid fitting, and etc), the new duct
will still be created at the specified connector position, and an InvalidOperationException is thrown.
See Also