Create Method (Document, ElementId, ElementId, Connector, XYZ)

Creates a new pipe that connects to the connector.

Namespace: Autodesk.Revit.DB.Plumbing
Assembly: RevitAPI (in RevitAPI.dll) Version: (17.0.484.0)
Since: 2015


public static Pipe Create(
	Document document,
	ElementId pipeTypeId,
	ElementId levelId,
	Connector startConnector,
	XYZ endPoint
Visual Basic
Public Shared Function Create ( _
	document As Document, _
	pipeTypeId As ElementId, _
	levelId As ElementId, _
	startConnector As Connector, _
	endPoint As XYZ _
) As Pipe
Visual C++
static Pipe^ Create(
	Document^ document, 
	ElementId^ pipeTypeId, 
	ElementId^ levelId, 
	Connector^ startConnector, 
	XYZ^ endPoint


Type: Autodesk.Revit.DB Document
The document.
Type: Autodesk.Revit.DB ElementId
The ElementId of the new pipe type.
Type: Autodesk.Revit.DB ElementId
The level id for the new pipe.
Type: Autodesk.Revit.DB Connector
The first connector where the new pipe starts.
Type: Autodesk.Revit.DB XYZ
The second point of the new pipe.

Return Value

The pipe.


The new pipe will have the same diameter and system type as the specified connector. The creation will also connect the new pipe to the component who owns the specified connector. 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.


Exception Condition
Autodesk.Revit.Exceptions ArgumentException The pipe type pipeTypeId is not valid pipe type. -or- The level id levelId is not valid. -or- The connector domain is not Domain.Piping. -or- The points of startConnector and endPoint are equal.
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 Thrown when the new pipe fails to connect with the connector.

See Also