Revit 2026 API
Rebar |
For shape driven rebar returns all possible RebarConstraints belonging to references from the provided element that could be used for a specified RebarConstrainedHandle.
For free form rebar will return an empty list.
Namespace: Autodesk.Revit.DB.Structure
Assembly: RevitAPI (in RevitAPI.dll) Version: 26.0.4.0 (26.0.4.0)
Syntax
public IList<RebarConstraint> GetConstraintCandidatesForHandle( RebarConstrainedHandle handle, ElementId elementId )
Public Function GetConstraintCandidatesForHandle ( handle As RebarConstrainedHandle, elementId As ElementId ) As IList(Of RebarConstraint)
public: IList<RebarConstraint^>^ GetConstraintCandidatesForHandle( RebarConstrainedHandle^ handle, ElementId^ elementId )
member GetConstraintCandidatesForHandle : handle : RebarConstrainedHandle * elementId : ElementId -> IList<RebarConstraint>
Parameters
- handle RebarConstrainedHandle
- The RebarConstrainedHandle for which constraint candidates are sought.
- elementId ElementId
- The elementId ( host or rebar ) of the element in which the candidates are searched for. It can be any host in the model or any bar from any host.
Return Value
IListRebarConstraintA collection of RebarConstraints

Exception | Condition |
---|---|
ArgumentException | elementId is not a valid RebarConstraint target element. |
ArgumentNullException | A non-optional argument was null |
InvalidOperationException | The RebarConstraintsManager does not manage a valid Rebar element. |

Will throw exception if the provided elementId is not a valid constraint target.
See Also