Rebar |
The RebarConstraintsManager type exposes the following members.
Name | Description | |
---|---|---|
![]() ![]() | IsRebarConstrainedPlacementEnabled | A static property defining if the 'Rebar Constrained Placement' setting is on or off in current Revit Application Session. |
![]() | IsValidObject | Specifies whether the .NET object represents a valid Revit entity. |
Name | Description | |
---|---|---|
![]() | AllowConstraintTargets | Returns true if references are valid targets for handle, false otherwise. |
![]() | ApplyRebarConstraints | Returns true if constraints were applied to rebar with success. |
![]() | ClearHandleConstraintPairHighlighting | Clears all highlighting in all views. |
![]() | Dispose | Releases all resources used by the RebarConstraintsManager |
![]() | Equals | Determines whether the specified object is equal to the current object. (Inherited from Object) |
![]() | GetAllConstrainedHandles | Retrieves all handles on the Rebar that are constrained to external references. |
![]() | GetAllHandles | Gets all RebarConstrainedHandles of this bar. |
![]() | GetConstraintCandidatesForHandle(RebarConstrainedHandle) | Obsolete. For shape driven rebar returns all possible automatic RebarConstraints that could be used for a specified RebarConstrainedHandle. For free form rebar will return an empty list. |
![]() | GetConstraintCandidatesForHandle(RebarConstrainedHandle, ElementId) | For shape driven rebar returns all possible RebarConstraints belonging to references from the provided element that could be used for a specified RebarConstrainedHandle. For free form rebar will return an empty list. |
![]() | GetConstraintCandidatesForHandle(RebarConstrainedHandle, Reference) | For shape driven rebar returns all possible RebarConstraints that will constrain RebarConstrainedHandle to the provided reference. For free form rebar will return an empty list. |
![]() | GetCurrentConstraintOnHandle | Retrieves the RebarConstraint that acts on the specified RebarConstraintHandle. |
![]() | GetHashCode | Serves as the default hash function. (Inherited from Object) |
![]() | GetPreferredConstraintOnHandle | For ShapeDriven: Returns the RebarConstraint that has been set as preferred for the specified RebarConstrainedHandle. For FreeForm: Returns the RebarConstraint that acts on the specified RebarConstraintHandle. |
![]() | GetType | Gets the Type of the current instance. (Inherited from Object) |
![]() | HasValidRebar | Checks whether the Manager's Rebar is still valid. |
![]() | HighlightHandleConstraintPairInAllViews | Highlights the specified RebarConstrainedHandle and RebarConstraint in all views. |
![]() | RemovePreferredConstraintFromHandle | For ShapeDriven: Clears the user-preferred RebarConstraint from the specified RebarConstrainedHandle. For FreeForm: Removes the RebarConstraint that is associated to the specified RebarConstrainedHandle. |
![]() | SetPreferredConstraint | Sets the RebarConstraint as preferred constraint for its RebarConstrainedHandle. |
![]() | SetPreferredConstraintForHandle | Obsolete. For ShapeDriven Rebar: Sets the RebarConstraint as preferred constraint target for the specified RebarConstrainedHandle. For FreeForm Rebar: Sets the RebarConstraint as the target for the specified RebarConstraintHandle. |
![]() | SetPreferredConstraintsToSurfaceForHandles | For ShapeDriven Rebar it will set a preferred 'ToSurface' RebarConstraint for each input handle. The surface that will be used by the constraint is the current surface that is used to compute the position of the handle. This function applies only for shape driven Rebar, and will throw exception for free form rebar. |
![]() | ToString | Returns a string that represents the current object. (Inherited from Object) |
A RebarConstraintsManager is created by calling Rebar.GetRebarConstraintsManager(), and can only be used to query or change constraints on the rebar element that created it.
The constraint manager has different behavior, depending on the type of Rebar that created it: Shape Driven or FreeForm
-----ShapeDriven-----
If the Rebar is Shape Driven, Revit uses the following logic to choose automatic constraints for each handle on a rebar element. First, a search is performed to find all suitable target planes, including surfaces of the rebar's host, as well as surfaces on other concrete host elements that are attached to the rebar's host. In the case of standard style rebar, any host surface occupied by a stirrup will be ignored, and instead, the handles on the stirrup itself will be treated as candidates to form a constraint.
Once all the constraint target candidates have been determined, the following sequence is used to select a constraint target:
Snapping tolerances are 0.5 * bar diameter for host surface cover constraints and 0.5 * (bar diameter + stirrup bar diameter) for stirrup handle constraints.
The RebarConstraintsManager allows the API developer to obtain the constraint candidates for each constrained handle on a rebar, and to override the default target selection logic by setting a particular constraint as preferred. The API developer will be able to choose an automatic constraint, or can get constraint candidates to any host in the model or to any Rebar in the model no matter what style it is (Standard or Stirrup). There can be set constraints to generic surfaces as well. This can be useful in a number of ways. First, it can be used to snap a handle to a particular host surface or stirrup rebar handle, or to position a handle at a precise distance from a host surface. Second, it can force a rebar handle to constrain itself to a particular target surface, even if other targets are closer (or will become closer in subsequent updates of the Revit model). For example, a bar can be constrained to maintain a constant offset distance from a face of an opening in a slab, even if the opening is placed close to the edge of the slab and the bar would normally constrain itself to the slab edge. Lastly, the override can be used to cancel the default standard bar preference for stirrup bar handle planes, and to allow standard bars to be constrained to host cover surfaces, even when a stirrup is present.
----- FreeForm -----
If the rebar is FreeForm, then it requires input constraints that will be consumed to obtain the actual shape of the bar. The calculation method of the constraints passed to the rebar is custom made by an API application - IRebarUpdateServer.
The RebarConstraintsManager can return all the possible "shape" handles and can set constraints created only with one of those handles. There are only active constraints on a FreeForm bar, the current and preferred notions represent the same thing.