CreateConstraintToSurface Method


Rebar Constraint Create Constraint To Surface Method

This method creates a constraint of 'To Surface' type for a given RebarConstrainedHandle.

The RebarConstrainedHandle should belong to a shape driven rebar, otherwise it will throw exception.


Namespace: Autodesk.Revit.DB.Structure
Assembly: RevitAPI (in RevitAPI.dll) Version: 25.0.0.0 (25.0.0.0)
Syntax
public static RebarConstraint CreateConstraintToSurface(
	RebarConstrainedHandle handle,
	Surface surface
)

Parameters

handle RebarConstrainedHandle
The handle of the rebar that will be constrained.
surface Surface
The surface that will be used by the constraint.

Return Value

RebarConstraint
Returns the newly created RebarConstraint.
Exceptions
Exception Condition
ArgumentException handle is no longer valid. -or- Constrained rebar isn't a shape driven rebar element. -or-
ArgumentNullException A non-optional argument was null
See Also
ArchiLabs Desktop

Put AI to work inside Revit.

Give Desktop your instructions and project files to build Revit families, update model elements, and create views and schedules. Works directly in Revit and AutoCAD.

Explore Desktop →