Creates a new duct that connects to the connector.
Namespace: Autodesk.Revit.DB.Mechanical
Assembly: RevitAPI (in RevitAPI.dll) Version: 24.0.0.0 (24.0.0.0)
Since: 2017
Syntax
C# |
---|
|
Visual Basic |
---|
|
Visual C++ |
---|
|
Parameters
- document
- Type: Autodesk.Revit.DBDocument
The document.
- ductTypeId
- Type: Autodesk.Revit.DBElementId
The ElementId of the new duct type.
- levelId
- Type: Autodesk.Revit.DBElementId
The level id for the new duct.
- startConnector
- Type: Autodesk.Revit.DBConnector
The first connector where the new duct starts.
- endPoint
- Type: Autodesk.Revit.DBXYZ
The second point of the new duct.
Return Value
The created duct.Remarks
The new duct will have the same diameter and system type as the specified connector. The creation will also connect the new duct to the component who owns the specified connector. 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.
Exceptions
Exception | Condition |
---|---|
Autodesk.Revit.ExceptionsArgumentException | 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 endPoint are too close: for MEPCurve, the minimum length is 1/10 inch. |
Autodesk.Revit.ExceptionsArgumentNullException | A non-optional argument was null |
Autodesk.Revit.ExceptionsDisabledDisciplineException | None of the following disciplines is enabled: Mechanical Electrical Piping. |
Autodesk.Revit.ExceptionsInvalidOperationException | Thrown when the new duct fails to connect with the connector. |