Create Method


Creates a new duct from two points.

Namespace: Autodesk.Revit.DB.Mechanical
Assembly: RevitAPI (in RevitAPI.dll) Version: 17.0.0.0 (17.0.484.0)
Since: 2014

Syntax

C#
public static Duct Create(
	Document document,
	ElementId systemTypeId,
	ElementId ductTypeId,
	ElementId levelId,
	XYZ startPoint,
	XYZ endPoint
)
Visual Basic
Public Shared Function Create ( _
	document As Document, _
	systemTypeId As ElementId, _
	ductTypeId As ElementId, _
	levelId As ElementId, _
	startPoint As XYZ, _
	endPoint As XYZ _
) As Duct
Visual C++
public:
static Duct^ Create(
	Document^ document, 
	ElementId^ systemTypeId, 
	ElementId^ ductTypeId, 
	ElementId^ levelId, 
	XYZ^ startPoint, 
	XYZ^ endPoint
)

Parameters

document
Type: Autodesk.Revit.DB Document
The document.
systemTypeId
Type: Autodesk.Revit.DB ElementId
The id of the HVAC system type.
ductTypeId
Type: Autodesk.Revit.DB ElementId
The id of the duct type.
levelId
Type: Autodesk.Revit.DB ElementId
The level ElementId for the duct.
startPoint
Type: Autodesk.Revit.DB XYZ
The start point of the duct.
endPoint
Type: Autodesk.Revit.DB XYZ
The end point of the duct.

Return Value

The created duct.

Exceptions

Exception Condition
Autodesk.Revit.Exceptions ArgumentException The systemTypeId is not valid HVAC system type. -or- The duct type ductTypeId is not valid duct type. -or- The level id levelId is not valid. -or- The points of startPoint 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.

See Also