RemovePreferredConstraintFromHandle Method


For ShapeDriven: Clears the user-preferred RebarConstraint from the specified RebarConstrainedHandle.

For FreeForm: Removes the RebarConstraint that is associated to the specified RebarConstrainedHandle.

Namespace: Autodesk.Revit.DB.Structure
Assembly: RevitAPI (in RevitAPI.dll) Version: 18.0.0.0 (18.0.0.420)
Since: 2014

Syntax

C#
public void RemovePreferredConstraintFromHandle(
	RebarConstrainedHandle handle
)
Visual Basic
Public Sub RemovePreferredConstraintFromHandle ( _
	handle As RebarConstrainedHandle _
)
Visual C++
public:
void RemovePreferredConstraintFromHandle(
	RebarConstrainedHandle^ handle
)

Parameters

handle
Type: Autodesk.Revit.DB.Structure RebarConstrainedHandle
The RebarConstrainedHandle for which the user RebarConstraint is to be deleted.

Remarks

ShapeDriven:

After the preferred constraint is removed, the rebar will search for an appropriate default constraint for the handle in its current position. In some cases, this will cause the handle to snap a small distance to a new target. However, in many situations, the handle will simply remain in its current position, and either continue to use the same constraint target (while no longer treating that target as preferred), or acquire a FixedDistancetoHostFace constraint to the nearest host element surface. The handle will not, in general, be restored to the position it originally occupied before the preferred constraint was applied.

FreeForm:

After the Constraint is removed, the handle remains unconstrained, and the shape calculation tries to resolve a shape without this information. Depending on the calculation method, the bar may not have all the necessary information, so the responsibility to constrain this handle is in the hands of the caller of this function.

Exceptions

Exception Condition
Autodesk.Revit.Exceptions ArgumentException handle is no longer valid.
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