AttachToHanger Method


Attaches the hanger rod to another bearer hanger.

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

Syntax

C#
public void AttachToHanger(
	ElementId hangerId,
	int rodIndex,
	XYZ position
)
Visual Basic
Public Sub AttachToHanger ( _
	hangerId As ElementId, _
	rodIndex As Integer, _
	position As XYZ _
)
Visual C++
public:
void AttachToHanger(
	ElementId^ hangerId, 
	int rodIndex, 
	XYZ^ position
)

Parameters

hangerId
Type: Autodesk.Revit.DBElementId
Identifier of the bearer hanger to which the rod attaches.
rodIndex
Type: SystemInt32
The index of the rod.
position
Type: Autodesk.Revit.DBXYZ
The position of the rod end. It should be on bearer centerline.

Exceptions

ExceptionCondition
Autodesk.Revit.ExceptionsArgumentException The hanger is not a bearer hanger. -or- The point is not on hanger bearer centerline.
Autodesk.Revit.ExceptionsArgumentNullException A non-optional argument was null
Autodesk.Revit.ExceptionsArgumentOutOfRangeException the index rodIndex is should be in range of rod count.

See Also

ArchiLabs

Stop fighting Revit automation.

Build repeatable BIM design and documentation workflows with scripts, data, and AI in one place, without wrestling brittle one-off automations.

Try ArchiLabs →