ReplaceReferenceTargets(IList<Reference>, RebarConstraintType) Method


Rebar Constraint Replace Reference Targets(IList Reference , Rebar Constraint Type) Method

Replaces the current set of references, with the newly provided ones. Will throw exception if this is a constraint for Shape Driven Rebar.

Namespace: Autodesk.Revit.DB.Structure
Assembly: RevitAPI (in RevitAPI.dll) Version: 27.0.4.0 (27.0.4.0)
Syntax
public void ReplaceReferenceTargets(
	IList<Reference> targetReferences,
	RebarConstraintType newConstraintType
)

Parameters

targetReferences IList Reference
The references to which the rebar handle will be constrained. This collection must contain one or more references to faces or edges of elements that can host rebar.
newConstraintType RebarConstraintType
The type of constraint to be set. Can only be 'ToCover', 'FixedDistanceToHostFace', 'ToHostEdge' or 'ToHostEdgeCover'. In case the type is 'ToHostEdge' or 'ToHostEdgeCover' the references must be of edges, otherwise of faces.
Exceptions
Exception Condition
ArgumentException targetReferences is empty. -or- newConstraintType is not 'ToHostEdge', 'ToHostEdgeCover', 'ToCover' or 'FixedDistanceToHostFace'. -or- targetReferences do not represent edges or faces from structurals that can host rebar. -or- The handle of the constraint do not accept this type of constraint.
ArgumentNullException A non-optional argument was null
ArgumentOutOfRangeException A value passed for an enumeration argument is not a member of that enumeration
InvalidOperationException Constrained rebar isn't a Free Form Rebar element.
See Also
ArchiLabs

Stop fighting Revit automation.

Build repeatable BIM design and documentation workflows with scripts, data, and AI in one place, without wrestling brittle one-off automations.

Try ArchiLabs →