CreateHanger Method (Document, FabricationServiceButton, Int32, ElementId)
Creates a free placed hanger.

Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 18.0.0.0 (18.0.0.420)
Since:  2017

Syntax

C#
public static FabricationPart CreateHanger(
	Document document,
	FabricationServiceButton button,
	int condition,
	ElementId levelId
)
Visual Basic
Public Shared Function CreateHanger ( _
	document As Document, _
	button As FabricationServiceButton, _
	condition As Integer, _
	levelId As ElementId _
) As FabricationPart
Visual C++
public:
static FabricationPart^ CreateHanger(
	Document^ document, 
	FabricationServiceButton^ button, 
	int condition, 
	ElementId^ levelId
)

Parameters

document
Type: Autodesk.Revit.DB..::..Document
The document.
button
Type: Autodesk.Revit.DB..::..FabricationServiceButton
The fabrication service button to use.
condition
Type: System..::..Int32
The condition index. If the button has multiple conditions.
levelId
Type: Autodesk.Revit.DB..::..ElementId
The level identifier of the hanger.

Return Value

The newly-created fabrication hanger.

Exceptions

ExceptionCondition
Autodesk.Revit.Exceptions..::..ArgumentException Invalid fabrication service button.
Autodesk.Revit.Exceptions..::..ArgumentNullException A non-optional argument was NULL
Autodesk.Revit.Exceptions..::..ArgumentOutOfRangeException the index condition is not larger or equal to 0 and less than ConditionCount

See Also