RebarConstraintCreate Method |
This method creates a constraint of 'ToHostFace' or 'ToCover' type for a given RebarConstrainedHandle.
Using this method for Shape-Driven Rebar will throw exception. If you need a new RebarConstraint for a handle of a Shape-Driven Rebar, you can obtain a list of possible constraints using one of the RebarConstraintsManager.GetConstraintCandidatesForHandle functions, choose the desired one, and set it as preferred.
Namespace: Autodesk.Revit.DB.StructureAssembly: RevitAPI (in RevitAPI.dll) Version: 27.0.4.0 (27.0.4.0)
Syntaxpublic static RebarConstraint Create(
RebarConstrainedHandle handle,
IList<Reference> targetHostFaceReferences,
bool isConstraintToCover,
double offsetValue
)
Public Shared Function Create (
handle As RebarConstrainedHandle,
targetHostFaceReferences As IList(Of Reference),
isConstraintToCover As Boolean,
offsetValue As Double
) As RebarConstraint
public:
static RebarConstraint^ Create(
RebarConstrainedHandle^ handle,
IList<Reference^>^ targetHostFaceReferences,
bool isConstraintToCover,
double offsetValue
)
static member Create :
handle : RebarConstrainedHandle *
targetHostFaceReferences : IList<Reference> *
isConstraintToCover : bool *
offsetValue : float -> RebarConstraint Parameters
- handle RebarConstrainedHandle
-
The handle of the rebar that will be constrained. This handle should not be allowed to constrain to an edge.
- targetHostFaceReferences IListReference
-
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 Boolean
-
If true the RebarConstraintType will be set to ToCover, otherwise RebarConstraintType will be set to FixedDistanceToHostFace.
- offsetValue Double
-
The distance from references to the rebar handle.
Return Value
RebarConstraint
Returns the newly created RebarConstraint.
Exceptions| Exception | Condition |
|---|
| ArgumentException |
Constrained rebar isn't a Free Form Rebar element.
-or-
handle is no longer valid.
-or-
targetHostFaceReferences is empty.
-or-
The RebarConstrainedHandle doesn't allow constraint of RebarConstraintType.FixedDistanceToHostFace or RebarConstraintTypeToCover type.
-or-
targetHostFaceReferences do not represent faces from structurals that can host rebar.
|
| ArgumentNullException |
A non-optional argument was null
|
See Also