GetBarIndexFromReference Method


Rebar Get Bar Index From Reference Method

Given a reference that represents a part of a bar, this method will return the bar index.

Namespace: Autodesk.Revit.DB.Structure
Assembly: RevitAPI (in RevitAPI.dll) Version: 25.0.0.0 (25.0.0.0)
Syntax
public int GetBarIndexFromReference(
	Reference barReference
)

Parameters

barReference Reference
The Reference of the Rebar element.

Return Value

Int32
The bar index the reference refers to.
Exceptions
Exception Condition
ArgumentNullException A non-optional argument was null
Remarks
The method returns an index between 0 and NumberOfBarPositions - 1 if it the given reference represents a part of a bar. Otherwise will return -1.
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 →