RebarConstraint.GetTargetElement(Int32) Method

RebarConstraintGetTargetElement(Int32) Method

Gets the Element object (either Host or Rebar) which provides the constraint. Will return the Element which contains the face at targetIndex.

Namespace: Autodesk.Revit.DB.Structure
Assembly: RevitAPI (in RevitAPI.dll) Version: 25.3.0.0 (25.3.0.0)
Syntax
public Element GetTargetElement(
	int targetIndex
)
Public Function GetTargetElement ( 
	targetIndex As Integer
) As Element
public:
Element^ GetTargetElement(
	int targetIndex
)
member GetTargetElement : 
        targetIndex : int -> Element 

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 constraint. Will return the Element which contains the face at targetIndex.
Exceptions
ExceptionCondition
ArgumentException targetIndex is out of range.
InvalidOperationException RebarConstraint is no longer valid. -or- The RebarConstraint should not be of RebarConstraintType 'ToSurface'.
See Also