RebarConstraintsManager.GetConstraintCandidatesForHandle(RebarConstrainedHandle)
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.
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).
[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
)
Parameter | Type | Description |
---|---|---|
handle | RebarConstrainedHandle | The RebarConstrainedHandle for which constraint candidates are sought. |
Type | Description |
---|---|
IList | A collection of RebarConstraints |
Exception | Condition |
---|---|
ArgumentNullException | A non-optional argument was null |
InvalidOperationException | The RebarConstraintsManager does not manage a valid Rebar element. |