ApplyRebarConstraints Method


Returns true if constraints were applied to rebar with success.

Namespace: Autodesk.Revit.DB.Structure
Assembly: RevitAPI (in RevitAPI.dll) Version: 19.0.0.0 (19.0.0.405)
Since: 2019

Syntax

C#
public bool ApplyRebarConstraints(
	IList<RebarConstraint> constraintsToApply,
	IList<Reference> oldTargets,
	IList<Reference> newTargets
)
Visual Basic
Public Function ApplyRebarConstraints ( _
	constraintsToApply As IList(Of RebarConstraint), _
	oldTargets As IList(Of Reference), _
	newTargets As IList(Of Reference) _
) As Boolean
Visual C++
public:
bool ApplyRebarConstraints(
	IList<RebarConstraint^>^ constraintsToApply, 
	IList<Reference^>^ oldTargets, 
	IList<Reference^>^ newTargets
)

Parameters

constraintsToApply
Type: System.Collections.Generic IList RebarConstraint
Represent the new constraints to be applied to rebar.
oldTargets
Type: System.Collections.Generic IList Reference
Represent the old target references.
newTargets
Type: System.Collections.Generic IList Reference
Represent the new target references.

Remarks

Experimental method. To be used under debug mode RebarAdaptiveCopy

ShapeDriven : The input constraints belong to other rebar in a (different) similar host. Only constraints of type ToHostFace or ToCover are considered. The method modifies the constraints' target references with their correspondants in current host(s). The modified constraints are set in current rebar. The method will fail : if there exists at least one ToOtherRebar constraint; if corresponding target references in current host(s) are not supplied or found.

FreeForm : Not defined yet. Always returns false.

The two arrays go hand in hand : they must have the same size; the correspondant of oldReference at index x is found in the other array at the same index x; This is a workaround for testing the functionality. The correspondant new targets in new host of old targets in original host.

Exceptions

Exception Condition
Autodesk.Revit.Exceptions ArgumentNullException A non-optional argument was NULL
Autodesk.Revit.Exceptions InvalidOperationException The RebarConstraintsManager does not manage a valid Rebar element.

See Also