Revit Smart Rebar System – Rebar Constraints

Revit Smart Rebar System – Rebar Constraints

BIMCAD Journalist 18/01/2024

Constraints system is a powerful Revit instrument, that allows user adding important dependencies between elements and create special behavior on changing one of them. Constraints can affect rebar shape, for example, stirrup constraints set to beam cover will make stirrup shape match this cover. Rebar constraints can be set not only to Host element face or cover, but to other rebars too. These constraints are very useful in terms of creating Beam Reinforcements. Revit API also provide functions to manage constraints.

Stirrups Cover Constraints


In Smart Rebar System during stirrups creating process constraints are set to Host cover to follow its shape. Rebar constraints operations in Revit API are controlled by RebarConstraintsManager class. The instance of this class can be get by GetRebarConstraintsManager() method of Rebar instance.

var rebarConstraintsManager = stirrup.GetRebarConstraintsManager();

With this manager we can find, set and remove any constraints related to this stirrup. However, to apply any constraint we need handle, that represent part of rebar/stirrup, such as Bar Start, Bar End, Bar Segment, Bar Edge, etc. To find these handles we can use GetAllHandles() method of RebarConstraintsManager instance to get list on handles for this stirrup.

var handles = rebarConstraintsManager.GetAllHandles();

Revit Stirrups Cover Constraints

Each handle has some basic parameters, such as name and type, that can be used to find specific handles. However, for Stirrup cover constraints it’s not necessary and we can move to the next step.

Next, we will get RebarConstraint list using GetConstraintCandidatesForHandle method of RebarConstraintsManager. Parameters for this method are handle and Element Id, that in our case is Beam Id. RebarConstraint has a lot of parameters, that can be used to filter and get specific constraints. For example, IsToCover() method will filter and return only Cover type constraints.

var toCoverConstraints = rebarConstraintsManager.GetConstraintCandidatesForHandle(handle, HostElement.Id).Where(x => x.IsToCover()).ToList();

After previous step we have list of matched constraints. However, constraint for handle can be only one. Since after creating stirrup, its shape follows Beam Face, to find the most matched constraint we will check the distance between handle and constraint and take closest one.

var closestToCoverConstraint = toCoverConstraints.OrderBy(x => Math.Abs(x.GetDistanceToTargetCover())).FirstOrDefault();

Revit Stirrups Cover Constraints

And at the next step we will set distance to zero to follow Beam Cover.

closestToCoverConstraint.SetDistanceToTargetCover(0);

The final step will be setting this constraint to handle using SetPreferredConstraintForHandle method of RebarConstraintsManager.

rebarConstraintsManager.SetPreferredConstraintForHandle(handle, closestToCoverConstraint);

Rebar to Stirrups Constraints


For 1st Layer bars skyACE Smart Rebar System use either Cover Constraints in case when there are no stirrups, or Rebar to Stirrups Constraints in case if we have stirrups. Steps until getting cover constraints are similar to Stirrups Cover Constraints.

Since we need to make constraints to other rebar, IsToCover() method won’t be suitable for us. Instead, we will search for angle of stirrup Hook/Bend using GetTargetRebarAngleOnBarOrHookBend() method of RebarConstraint instance. This value is representing angular location of around hook (detailed explanation from API Docs), and using it we can find specific point – midpoint in our case – with what we need to create constraints.

The final step is equal to Cover Constraints – set this constraint to handle using SetPreferredConstraintForHandle method of RebarConstraintsManager.

rebarConstraintsManager.SetPreferredConstraintForHandle(handle, closestToCoverConstraint);

Revit Rebar to Stirrups Constraints

Rebar to Other Rebar


One more case, that using Rebar Constraints is to make dependencies between layers of different layers. This type of constraints is required more changes comparing with previous ones. First, we will use handle type value from GetHandleType() method of RebarConstrainedHandle instance. Using this type, we will search for RebarConstraint with TargetRebarConstraintTypeEdge, RebarPlane or  OutOfPlaneExtent corresponding to handle type. Depending on TargetRebarConstraintType.

Same as for Stirrups Cover Constraints, we will take into account DistanceToTargetRebar and find closest constraint. Distance between rebars can be either as spacing between their centers or as a clear distance offset. This parameter can be controlled by SetToUseClearBarSpacing() method of RebarConstraint type. For  RebarPlane and OutOfPlaneExtent types distance should between bar centers and – in our case – set to zero. As for Edge, distance required to be as a clear space. Final step is similar to other cases.

Revit Rebar To Other Rebar Constraints

Revit Rebar Constraints have multiple use cases and posibilites. Implementations above – just a few practical examples, that show a potential of using it through Revit API.

Tags:
Share:
Get a free consultation
contact us
Fill out the form and contact us today for an absolutely free consultation of anything related to BIM/CAD.
footer
logo
text-logo
Quality & Information Security
are at the core of our priorities.
iso9001
iso27001
awardsaokhue
Contact
Email:sales@tgl-sol.com
Hotline:(+84) 377 359 728
Ho Chi Minh Office:42/1 Ung Van Khiem Street, Ward 25, Binh Thanh District, Ho Chi Minh
Da Nang Office:01 Tran Van Ky Street, Hoa Khanh Nam Ward, Lien Chieu District, Da Nang
Headquarter:3F Tojikyo Building, 16-2 Kodenmacho, Nihonbashi, Chuo-ku, Tokyo, Japan
Follow Us
BIM/CAD © 2023 All Rights Reserved
Hey 👋 I'm right here to help you, so just click the chat button.