RVTDocs.com

RebarConstraintsManager.GetConstraintCandidatesForHandle(RebarConstrainedHandle)

Method
Description:
For shape driven rebar returns all possible automatic RebarConstraints that could be used for a specified RebarConstrainedHandle.For free form rebar will return an empty list.
Remarks:

When a bar is placed or moved is searching for new constraints in and automatic way, which are the ones returned by this function. This list contains possible constraints to host's faces and cover and to the first level host neighbors' faces and cover. If this is a Rebar of Standard style the list will contain possible constraints to Stirrup bars (corners or segments).

If you want to get all possible constraints to host or to another rebar (no matter what style it is) you should use RebarConstraintsManager.GetConstraintCandidatesForHandle(Autodesk.Revit.DB.Structure.RebarConstrainedHandle, Autodesk.Revit.DB.ElementId) or RebarConstraintsManager.GetConstraintCandidatesForHandle(Autodesk.Revit.DB.Structure.RebarConstrainedHandle, Autodesk.Revit.DB.Reference).

Syntax
[ObsoleteAttribute("This property is deprecated in Revit 2025 and may be removed in a later version of Revit. Please use RebarConstraintsManager.GetConstraintCandidatesForHandle(Autodesk.Revit.DB.Structure.RebarConstrainedHandle, Autodesk.Revit.DB.ElementId) or RebarConstraintsManager.GetConstraintCandidatesForHandle(Autodesk.Revit.DB.Structure.RebarConstrainedHandle, Autodesk.Revit.DB.Reference) instead. If you want to get the direct neighbors of a rebar host you can use Autodesk.Revit.DB.Structure.RebarHostData.GetRebarHostDirectNeighbors(Autodesk.Revit.DB.Element hostElement). If you want to get all the rebars in a host you can use Autodesk.Revit.DB.Structure.RebarHostData.GetRebarsInHost().")]
public IList<RebarConstraint> GetConstraintCandidatesForHandle(
	RebarConstrainedHandle handle
)
Parameters
Parameter Type Description
handle RebarConstrainedHandle The RebarConstrainedHandle for which constraint candidates are sought.
Return Value
Type Description
IList A collection of RebarConstraints
Exceptions
Exception Condition
ArgumentNullException A non-optional argument was null
InvalidOperationException The RebarConstraintsManager does not manage a valid Rebar element.