GetBarIndexFromReference 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: 24.0.0.0 (24.0.0.0)
Since:  2022

Syntax

C#
public int GetBarIndexFromReference(
	Reference barReference
)
Visual Basic
Public Function GetBarIndexFromReference ( _
	barReference As Reference _
) As Integer
Visual C++
public:
int GetBarIndexFromReference(
	Reference^ barReference
)

Parameters

barReference
Type: Autodesk.Revit.DBReference
The Reference of the RebarInSystem element.

Return Value

The bar index the reference refers to.

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.

Exceptions

ExceptionCondition
Autodesk.Revit.ExceptionsArgumentNullException A non-optional argument was null

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 →