Create Method


This method creates a constraint for a given Rebar Constrained Handle Tag. Will throw exception if used for Shape Driven Rebar.

Namespace: Autodesk.Revit.DB.Structure
Assembly: RevitAPI (in RevitAPI.dll) Version: 24.0.0.0 (24.0.0.0)
Since:  2018

Syntax

C#
public static RebarConstraint Create(
	RebarConstrainedHandle handle,
	IList<Reference> targetReferences,
	bool isConstraintToCover,
	double offsetValue
)
Visual Basic
Public Shared Function Create ( _
	handle As RebarConstrainedHandle, _
	targetReferences As IList(Of Reference), _
	isConstraintToCover As Boolean, _
	offsetValue As Double _
) As RebarConstraint
Visual C++
public:
static RebarConstraint^ Create(
	RebarConstrainedHandle^ handle, 
	IList<Reference^>^ targetReferences, 
	bool isConstraintToCover, 
	double offsetValue
)

Parameters

handle
Type: Autodesk.Revit.DB.StructureRebarConstrainedHandle
The handle of the rebar that will be constrained.
targetReferences
Type: System.Collections.GenericIListReference
The references to which the rebar handle will be constrained. This collection must contain one or more references to faces of elements that can host rebar.
isConstraintToCover
Type: SystemBoolean
If true the RebarConstraintType will be set to ToCover, otherwise RebarConstraintType will be set to FixedDistanceToHostFace.
offsetValue
Type: SystemDouble
The distance from references to the rebar handle.

Return Value

Returns the newly created RebarConstraint.

Exceptions

ExceptionCondition
Autodesk.Revit.ExceptionsArgumentException Constrained rebar is a shape driven rebar element. -or- handle is no longer valid. -or- targetReferences is empty. -or- targetReferences do not represent faces from structurals that can host rebar.
Autodesk.Revit.ExceptionsArgumentNullException 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 →