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


Creates a new flexible duct into the document, using a point array and flexible duct type.

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

Syntax

C#
public static FlexDuct Create(
	Document document,
	ElementId systemTypeId,
	ElementId ductTypeId,
	ElementId levelId,
	IList<XYZ> points
)
Visual Basic
Public Shared Function Create ( _
	document As Document, _
	systemTypeId As ElementId, _
	ductTypeId As ElementId, _
	levelId As ElementId, _
	points As IList(Of XYZ) _
) As FlexDuct
Visual C++
public:
static FlexDuct^ Create(
	Document^ document, 
	ElementId^ systemTypeId, 
	ElementId^ ductTypeId, 
	ElementId^ levelId, 
	IList<XYZ^>^ points
)

Parameters

document
Type: Autodesk.Revit.DBDocument
The document.
systemTypeId
Type: Autodesk.Revit.DBElementId
The id of the HVAC system type.
ductTypeId
Type: Autodesk.Revit.DBElementId
The id of the flexible duct.
levelId
Type: Autodesk.Revit.DBElementId
The level id for the flexible duct.
points
Type: System.Collections.GenericIListXYZ
The point array indicating the path of the flexible duct, including the end point.

Return Value

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

Exceptions

ExceptionCondition
Autodesk.Revit.ExceptionsArgumentException The systemTypeId is not valid HVAC system type. -or- The type ductTypeId is not valid flexible duct type. -or- The ElementId levelId is not a Level. -or- The valid number of points is less than two. In order to create a flex curve, at least two points are required. Note the duplicate points don't take into account.
Autodesk.Revit.ExceptionsArgumentNullException A non-optional argument was null
Autodesk.Revit.ExceptionsDisabledDisciplineException None of the following disciplines is enabled: Mechanical Electrical Piping.

See Also

ArchiLabs Desktop

Put AI to work inside Revit.

Give Desktop your instructions and project files to build Revit families, update model elements, and create views and schedules. Works directly in Revit and AutoCAD.

Explore Desktop →