In this blog post, I’ll continue the subject I started a few weeks ago. In Part 1 I covered how structural engineers and detailers can automate reinforcement designs with Dynamo in the example of straight rebars around window and door openings. Let’s extend the functionality of the script by adding additional rebars for wall openings.
1) Before we wire the OpeningDiagonalRebarCurves node to the right data, we need to calculate a spacing between diagonal rebars.
2) Now, we are ready to generate curves for diagonal rebars.
3) Now, it’s time to create rebars in Revit.
4) The final step is a definition of a rebar set if spacing is greater than 0 (Two Layers is true).
Before we move on, let’s take care of rebar visibility as we would like to have the generated rebars presented as solid and unobscured in the active view.
1) First, let’s group all rebars we created so far into a list.
2) Next, let’s retrieve the current active view.
3) To set up rebar visibility we will use the SetUnobscuredInView and the Create.SetSolidInView nodes. The second node takes a 3D View as an input parameter, so we need to check if the current view is a 3D View.
4) Finally, we can set up rebar visibility. The unobscured and solid input parameters are true by default.
Let’s continue and create the remaining rebars. Now we are going to create top boundary stirrups.
As you can see on the above image depending on the Top Stirrup is Closed parameter value (true/false) we will be getting two different types/shapes of stirrups.
In the Structural Design package, you can find two respective nodes that support creations of these two shapes (Structural Design->Rebar->Designs).
Returns closed stirrup shape rebar curves.
Returns U-shape rebar curves.
They both also return the normal vector to the plane that the rebar curve lies on.
1) First, we need to retrieve all top curves openings that were collected during the selection process. To get such list of top curves we need to collect all second items of the Curves[ ] list.
Note: That in this case we’re getting 4 items as 4 openings were selected.
2) Next connect the right data with the *ShapeCurves
3) Later we will need the lengths of the curves so let’s get these values using the Design Script syntax.
4) Having the stirrup geometry defined, it’s time to add a logic that will manage what kind of stirrup is used. We will do this using the Python Script. Our simple Python Script will return the result of the node’s inputs passed through an embedded IronPython script. We will define 3 inputs:
- condition – a value of the Top Stirrup is Closed parameter
- closedStirrups – a list of curves to create closed stirrups
- uShapeStirrups – a list of curves to create U-shape stirrups
5) Next, we need to translate a representative stirrup the half stirrup spacing distance along the top border of the opening.
6) Now we can create rebars in Revit, but before we do this we need to check if the creation of stirrups makes sense (if the Two Layers parameter is True). Again, in this case we will use the Python Script node and write a simple script.
7) Because the RebarHookType depends on the Top Stirrup is Closed parameter, we need to check it first and then connect the right type to the FromCurves node.
8) Now we are ready to create rebars.
9) To define a rebar set from our stirrup we need to calculate arrayLength In this case again we can use the Code Block node to provide a formula and renaming the node we can call it respectively.
10) Finally, we have everything to create a set of stirrups.
The process of creation of the bottom and side rebars is very similar. The final script can be found here.
The visual programming interface of Dynamo gives structural engineers the tools to build optimized structures with minimal energy, and subsequently make their own design tools. Based on the Revit Platform, we can use our creativity to develop optimized structural systems using computational logic in an advanced building information modeling environment.
The combination of the Revit information database and scripting with Dynamo opens a world of possibilities to working fast with complex and optimized structures. The exercise we have gone through provides just a few examples. Now, make your own design solutions and share them with the world!