Creates a new pipe that connects to two connectors.
Namespace: Autodesk.Revit.DB.Plumbing
Assembly: RevitAPI (in RevitAPI.dll) Version: 24.0.0.0 (24.0.0.0)
Since: 2015
Syntax
C# |
---|
|
Visual Basic |
---|
|
Visual C++ |
---|
|
Parameters
- document
- Type: Autodesk.Revit.DBDocument
The document.
- pipeTypeId
- Type: Autodesk.Revit.DBElementId
The ElementId of the new pipe type.
- levelId
- Type: Autodesk.Revit.DBElementId
The level ElementId for the new pipe.
- startConnector
- Type: Autodesk.Revit.DBConnector
The first connector where the new pipe starts.
- endConnector
- Type: Autodesk.Revit.DBConnector
The second point of the new pipe.
Return Value
The pipe.Remarks
The new pipe will have the same diameter and system type as the start connector. The creation will also connect the new pipe to two component who owns the specified connectors. If necessary, additional fitting(s) are included to make a valid connection. If the new pipe can not be connected to the next component (e.g., mismatched direction, no valid fitting, and etc), the new pipe will still be created at the specified connector position, and an InvalidOperationException is thrown.
Exceptions
Exception | Condition |
---|---|
Autodesk.Revit.ExceptionsArgumentException | The pipe type pipeTypeId is not valid pipe type. -or- The ElementId levelId is not a Level. -or- The connector domain is not Domain.Piping. -or- The points of startConnector and endConnector 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 pipe fails to connect with the connector. |