RebarConstraintsManager.GetConstraintCandidatesForHandle(RebarConstrainedHandle)
For shape driven rebar returns all possible 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).
public IList<RebarConstraint> GetConstraintCandidatesForHandle(
RebarConstrainedHandle handle
)
-
handleThe RebarConstrainedHandle for which constraint candidates are sought.
-
A non-optional argument was NULL
-
The RebarConstraintsManager does not manage a valid Rebar element.