GetTargetElement Method (Int32)


Rebar Constraint Get Target Element(Int 32) Method

Gets the Element object (either Host or Rebar) which provides the target reference at specified index for this constraint.

Namespace: Autodesk.Revit.DB.Structure
Assembly: RevitAPI (in RevitAPI.dll) Version: 27.0.4.0 (27.0.4.0)
Syntax
public Element GetTargetElement(
	int targetIndex
)

Parameters

targetIndex Int32
The index of the target. Should be between 0 and NumberOfTargets().

Return Value

Element
Returns the Element object (either Host or Rebar) which provides the target reference at specified index for this constraint.
Exceptions
Exception Condition
ArgumentException targetIndex is out of range.
InvalidOperationException RebarConstraint is no longer valid. -or- The RebarConstraint should not be of RebarConstraintType 'ToSurface'. -or- The RebarConstraintType of the RebarConstraint is 'ToCustomTarget'.
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 →