
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.
Diagonal Rebars
The Dynamo script I built in Part 1 can be found here. Creating diagonal rebars is very similar to what we have done for straight ones.
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).
Rebar Visibility
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.
Boundary Stirrups
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 version 1.2.2 of this package is optimized for Dynamo Revit 2.1 and Revit 2020.1. Take a look at the “extra” folder for some examples that can be used with the Dynamo Player. Contact with the author if any questions: @tomekf
The final script covered in this post can be found in the extra folder.
c:\Users\{userName}\AppData\Roaming\Dynamo\Dynamo Revit\2.6\packages\Structural Design\extra
Summary
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!
Hi Tomasz, Cool script which saves a tone of time. I took your script from the Extra folder and tried to run it on an example wall with openings. I get the message "Run completed with errors" in the Dynamo player. Could you help me in any way to make it run? Thank you.
Hello, is a possibility to download parameters of opening from instance parameters of opening, not type parameters? I have Revit family, where needed parameters are instance parameters. Regards
Hey, thanks of the work flow. I sketched a basic model of a wall with 2 door openings and I am following you instructions but for some reason I am receiving error and the category is not extracting the model doors... Is it because I need to build the whole code including your follow up parts for it to work properly?
You don't need to do that. If you send me your script + rvt then I can tell you what you're doing wrong.
Hi Tomasz, our company started to model the rebars in our bim models, can you give me the link or email me the script that you created, it will be of great help for us, many thanks in advanced brother. -arnel
c:\Users\{userName}\AppData\Roaming\Dynamo\Dynamo Revit\2.6\packages\Structural Design\extra The AppData folder is a hidden item so make sure you have them displayed in your file explorer.
Hello. Thanks for all your efforts. Would please say where can I find the extra folder?
Hi Tomasz, I can't seem to access the folder where you put the scripts, can you kindly give me a link too. Thanks -Arnel
The AppData folder is a hidden item so make sure you have them displayed in your file explorer. c:\Users\{userName}\AppData\Roaming\Dynamo\Dynamo Revit\2.6\packages\Structural Design\extra
c:\Users\{userName}\AppData\Roaming\Dynamo\Dynamo Revit\2.5\packages\Structural Design\extra
hello friend good day excellent contributions from dynamo I am new and I like challenges and I have many queries, can you give me an email with my questions
Hi Tomasz! I would like to some help if possible I ported your script to 2020.1 and it works flawlessly with default doors and windows, but the thing is, when i run the script on a "door/window-opening family", it gets the dimensions and id stated under a group named: "Get window/door opening characteristics - in a block called "Selection.PickObjectsOfCategory: as "1200x2100mm" "1992028" but the connected node called "Geometry.WindowDoorOpeningCharacteristics" shows "null" behind the following: "HostWidth,Plane,Host,Category,Curves,Height,Width,Normal and Points". And the script cannot continue from here on out. Running Revit 2020.1 Dynamo Core 2.1.0.7733 Structural Design 2019.12.11 Thank you for any help you can offer. Tom
Please send me your files, then I can help you.
Hi Tomasz! Very interesting script! I'm trying to built it up as exercise to see how it works, and I'm doing it wwith the Revit 2019.2 version and Dynamo Revit 2.0.3. It works all fine till now, but when I try to create the stirrups for the lintel , the script crash on option 'closedStirrups'... the python script for open/closed option give a " NameError: name 'closedStirrups' is not defined " message. Do you know what should I do to avoid that, or what could be the reason for it? Thanks in advance!!
Hi Marco, I am glad you like it. Which version of the package you have installed? recently I made a couple of updates in nodes and their names have been changed too. Take a look at the "extra" folder for some examples that can be used with the Dynamo Player. You can find there the script you are trying to build. Let me know if any question @tomekf.
Hi Tomasz I can't select openings in my model, where am I wrong? (trying with both Revit 2019 and 2020) Thanks in advance Umberto
Your doors and windows are nor visible in your Revit view. Please make sure in the Visibility/Graphic Overrides dialog you have the Doors and Openings categories checked 🙂
Hi Tomasz, we are using the opening familiy from Sofistik's Bimtools (works with voids). Is it possible to run your script with that categorie "generic models" as well, respectively could it be changed so that it works? thanks in Advance!
Hi Mario, I developed and tested this only with the windows and doors categories in mind. The script gets the number of information from selected objects(e.g. a type: checks if a door or a window is selected) and then depending on a type of an opening it generates rebars respectively. I believe the script could be adjusted to your needs - the selection & retrieve data part of the script would need to be adjusted then.
hello TOMASZ, how long did it take you to finish the whole script:)?
The script itself was easy when I had my package nodes finalized :)
I have a problem with this script when i try to launch it in Dynamo player. I have an error with System.Xml.XmlException
It's clearly said the package works with Dynamo 2. You run it with Dynamo 1.3 that's why you have a problem.
So like a few others I can see I am having a problem after selecting my openings. They work through the Selection.PickObjectsOf Category and gives outputs. Entering the next node being the get opening characteristics it gives only null values and I am making sire to use default windows and doors built into revit and still only given null values. Is there a node we need to feed selection into before geometry?
https://blogs.autodesk.com/revit/2019/02/07/structural-design-package-version-1-0-5/
Also, do you think it could be the problem because I am using Revit 2019 so I should update to 2019.1 or 2019.2 Do you have any idea when we can be will be able to change The Geometry.GetWindowDoorOpeningCharacteristics node I am working on reinforcement for Beam and column with Dynamo but this time I am using DataShap to select the structural framing and faces, and I would like you to take a look on it, do you have any mail that I can send the scripts Thanks you :)
It works with Revit 2019.2 too. If you would like to share your script please use Dropbox, Box or any other service.
Dear Tomasz, thanks a lot for sharing the information with us, i just have a small problem what i can select the Door/window opening when i run the script, note that i can select it without running the script, i already check *Visibility/Graphic Overrides dialog you have the Doors and Openings categories checked*.... i have another question, is it possible that you show how to change python string “Width” and “Height”, because it's not easy to change for big projects, thanks in Advance :)
https://blogs.autodesk.com/revit/2019/02/07/structural-dynamo-package-version-1-0-5/
Dear Tomasz, (i think I had misspelling ) thank for your support thanks a lot for sharing the information with us, i just have a small problem that i can't select the Door/window opening when i run the script, but i can select it without running the script, I already check *Visibility/Graphic Overrides dialog you have the Doors and Openings categories checked*…. i have another question, is it possible that you show how to change python string “Width” and “Height”, because it’s not easy to change the parameters when I am working on big projects, thanks in Advance 🙂
I am not getting your issue, could you be more descriptive or provide a short video or a screenshot? You are saying that "you can select windows and doors without running the script" - so my question is why wouldn't you able to select them :) - your statement is without a context. If you meant that you want to have your preselection taken into account when running the script you should set up the preselection parameter as true. By default the selcetion node has this input parameter set as false. The Geometry.GetWindowDoorOpeningCharacteristics node will be updated soon. You will be able to overwrite the names of parameters then. Hope that helps and answers to your questions.
and another issue, do you think if the opening has a different name than “Width” and “Height” I won't be able to select it?
The Geometry.GetWindowDoorOpeningCharacteristics node will be updated soon. You will be able to overwrite the names of parameters then.
Running the script prompts the error Selection.PickObjectsOfCategory node.”The user aborted the pick operation.”
Now you can adjust: https://blogs.autodesk.com/revit/2019/02/07/structural-dynamo-package-version-1-0-5/
It's done! Thank you very much!
Geometry.GetWindowDoorOpeningCharacteristics is error.I want to know how to adjust Revit in Chinese version.
When I run the script, I can't select windows and doors.
Question: Did you select any windows or doors? You need to select at least one.
I'd like to see your complete dyn file, okay?
jiandanlll@163.com
This website can't open, can you send me a mailbox?
It works well. Make sure you click the download button...
There is a link to the final dynamo script (*.dyn) at the end of the post.
Thank you for your effort. I used the node for generating rebar with Create.FreeFormRebar . But I found that there is a limitation on the rebar location points number. The number is 1002. I want to ceate a sprial rebar with 2600 points. Is there some way to generated it with Create.FreeFormRebar? I will appreciate for your answer. Thank you in advance
Why did you use the Create.FreeFormRebar node? To get a spiral rebar you should: 1) Create a set of dynamo arcs based on your column geometry 2) Create a rebar element (stirrup) using the Create.FromCurves node 3) Next you should use the Create.SetRebarShapeId node to change the rebar shape to the shape #53 (spiral). I hope it helps you.
Could you send your datasets (rvt+dyn)? I need to better understand a problem you are trying to solve.
DEAR TOMASZ, Thank you for your effort, I tried you to use this script for an example project, but unfortunately, when I run the Dynamo play and I go to Revit it doesn't let me select the window opening when I press finish I got an error message "Run completed with errors", I hope I can get feedback on how I can do it :) Have a nice day
Please make sure in the Visibility/Graphic Overrides dialog you have the Doors and Openings categories checked :-) then you should be able to select openings and run the script without any issues. Also you should use metric units in your project - Length [mm].