NewDuct Method (Connector, Connector, DuctType)


Adds a new duct into the document, using two connectors and duct type.

Namespace: Autodesk.Revit.Creation
Assembly: RevitAPI (in RevitAPI.dll) Version: 17.0.0.0 (17.0.484.0)

Syntax

C#
[ObsoleteAttribute("This method is obsolete in Revit 2017. Please use Duct.Create() instead.")]
public Duct NewDuct(
	Connector connector1,
	Connector connector2,
	DuctType ductType
)
Visual Basic
<ObsoleteAttribute("This method is obsolete in Revit 2017. Please use Duct.Create() instead.")> _
Public Function NewDuct ( _
	connector1 As Connector, _
	connector2 As Connector, _
	ductType As DuctType _
) As Duct
Visual C++
[ObsoleteAttribute(L"This method is obsolete in Revit 2017. Please use Duct.Create() instead.")]
public:
Duct^ NewDuct(
	Connector^ connector1, 
	Connector^ connector2, 
	DuctType^ ductType
)

Parameters

connector1
Type: Autodesk.Revit.DB Connector
The first connector to be connected to the duct.
connector2
Type: Autodesk.Revit.DB Connector
The second connector to be connected to the duct.
ductType
Type: Autodesk.Revit.DB.Mechanical DuctType
The type of the duct.

Return Value

If creation was successful then a new duct is returned, otherwise an exception with failure information will be thrown.

Remarks

If the connectors are fitting or equipment connectors of the correct domain, and if the connectors' direction match the direction of the duct to be created, the connectors will be automatically connected. A transition fitting will be added at the connector(s) if necessary. If the connector's type, domain, or direction does not match the direction of the duct to be created, the position of the input connectors will govern the endpoints of the duct, but no connection will be established.

Exceptions

Exception Condition
Autodesk.Revit.Exceptions ArgumentNullException Thrown when the input argument connector1 or connector2 is a null reference ( Nothing in Visual Basic) .
Autodesk.Revit.Exceptions InvalidOperationException Thrown when the duct cannot be created or regenerate fails.
Autodesk.Revit.Exceptions ArgumentException Thrown if the duct type does not exist in the given document.

See Also