Rebar productivity tools for Revit with Dynamo

I finally started to gather all the custom nodes I have been creating for the creation of rebar objects in Revit using Dynamo. Besides using the Dynamo for Rebar package from CORE Studio, I also created some small productivity tools that can help you driving your rebar design. The package for Dynamo that has been published is called BIM4Struc.Rebar.

At this moment it consists of a limited number of custom nodes, but there will be added more and more, as AU gets nearer.

The ones that exist now in the package as a starter:

2016-06-17_12-01-42

Rebar.GetHost returns the Revit ID of the host that contains the rebar object. In case that the rebar is not hosted, then it will be returned in the NonHostedRebar.

Rebar.GetCenterlineCurve is a node that returns the sketch geometry of a rebar, which is in fact the centerline. This is very handy when distributing existing complex rebars along 3D curves (using the Dynamo for Rebar package again).

Rebar.GetProperties is a node that extracts all necessary rebar properties from a selected rebar in Revit. These properties can be used in combination with the Dynamo for Rebar creation nodes to copy existing rebar for instance.

This helped me to make a quite short script to build the rebar in this double curved deck.

2016-06-17_12-13-27 2016-06-17_12-15-46 2016-06-17_12-18-10

There will be explained more on this in future blog posts !

See keep an eye on it !

Advertisements

Clearance Height on Stairs – Watch your head!

The ergonomics of a stair is not only about the tread depth, the riser height, the stair slope, … It is also about the safety of your head when you walk the stair. Ever been in a situation when you rushed down the stair to the cellar and then bumped your head against one of the floor beams 😉

In this post I will explain you how to create your own Dynamo script for the “Clearance Height Check” of your stairs in a Autodesk Revit project. The Dynamo script (which can be downloaded at the bottom of this post) works on a selected stair and will verify the “Clearance Height” or “Headroom” between the tread top surfaces and the objects above. The results will then be displayed as colored lines.

      

The script consists of 7 main parts, organized in node groups. Each of the steps is described below.

Step 1 – Input

In this step you need to select the stair that you want to analyze. This can be a single or a multi-story stair.
The Safety Offset parameter is explained in Step 3 further in this post.
And of course you need to set a constraint for the “Clearance Height” in the last parameter.

Step 2 – Detection of top surfaces of treads and landings

When you import the stair geometry into Dynamo, it’s considered as one single solid. This means you can’t detect the individual treads (with the native nodes). In this case we use the Element.Faces node to detect all the surfaces of the solid. Each of these surfaces has a normal vector (Surface.NormalAtParameter). The surfaces with a Z-value of this vector equal to 1, are the top horizontal surfaces of the stair. In this case these are the treads and landings, but also the smaller end surfaces of the supports or stringers. In the first List.FilterByBoolMask these top surfaces are filtered (results is in the in output). In the second List.FilterByBoolMask the surfaces with an area smaller than the tread area (= width * tread depth) are filtered out (the in output represents the surfaces with a greater or equal area).

Now we have the references of the treads and landings which represent the bottom of our “Clearance Height” calculation.

Step 3 – Detecting the upper elements with ray bouncing

This part of the script will generate the “calculation” elements by

  1. creating a point in the middle of each top surface (Surface.PointAtParameter)
  2. translating the points vertically with a distance equal to the indicated “Safety Offset”. This is done to avoid the point being inwards the solid of the tread. In a later step we will add this 50 mm value to the resulting clearance height.
  3. using the points as origins for the RayBounce.ByOriginDirection which will cast rays in an upward direction until it meets an object on it’s way. The output of this node consists of Points, which are the start- and endpoints of the single ray (maxBounces=1 and Elements which represent the family instances that are hit by the ray.
  4. connecting the start- and endpoints by means of the PolyCurve.ByPoints node.

These polycurves can now be used to calculate the headroom and visualize the results in the next steps.

Step 4 – Visualization of environment

In this optional step, the elements that are hitted by the rays are displayed within the Dynamo GUI. Play with the Number Slider to manage the transparency of the objects.

Step 5 – Check the Clearance Height

The smallest but nevertheless the most important part of the script checks the length of each designed polycurve (from Step 3) and adds the Safety Offset value (50 mm) to the result. The output is verified with the Minimal Clearance Height, indicated in the Input group. This results in list with “true” and “false” values which then will be used for filtering.

Step 6 – Creation of analysis samples in Revit

The polycurves, created in step 3 can now be used to create “Model Lines” in Revit, in order to visualize the possible problems with clearance heights. As the ModelCurve.ByCurve can not accept polycurves, we need to explode these in lines first. Graphically you can’t see any difference as the “unexploded” and the “exploded” version still show a two-point line. But the data type is different…

Optionally you change the style of the model lines, to have better representation and filtering capabilities in Revit. Therefore the Archi-lab / Grimshaw package offers the Get Line Style by Name node that loads a line style to Dynamo which is used to change the initially created line.

Step 7 – Visualization of the results

This last step will change the appearance of the lines created either in Dynamo either in Revit, depending on the Clearance Height requirements. If the length of the polycurve +50 mm, hence the real headroom, doesn’t meet the minimal clearance, then the line is colored in red, otherwise it is colored in green. This graphical result can help you to solve the problem with the surrounding elements and re-run the script to see the new results.

Datasets

The Dynamo script and the Revit sample file (originally the rac_advanced_sample_project.rvt) can be downloaded here.

Evacuation Path Analysis with Dynamo

More and more I’ve been challenged and inspired to find new ways to perform custom architectural analysis. In this post I want to share with you a short and simple (for once) Dynamo script that can be used to analyze the evacuation paths in your building design in Revit. The script (that you can download at the bottom of this post) will calculate the accumulated distance from several points to a selected emergency exit and display the results in a selected Revit view.

Evacuation Path Analysis - 07

Before you start setting up or running the script you need to draw the evacuation paths in your Revit model. In this case Model Lines are used with a specific, newly created line style called “Evacuation Path”.

Evacuation Path Analysis - 05

It’s also necessary to have these next Dynamo packages installed:

  • Lunchbox
  • Grimshaw (archi-lab.net)
  • Ampersand

Packages

When you then open the Dynamo script “Evacuation Path Analysis.dyn” you will see 4 parts.

1. Input geometry in Dynamo

Evacuation Path Analysis - 01

In this part the model lines of style Evacuation Path are selected and their geometry is generated in Dynamo. For this selection the custom node Select Model Lines by Style from the Grimshaw (archi-lab.net) package is used.

You will also need to select the door that will function as the emergency exit. This will be used further in the script to detect the evacuation direction.

The “CurveDiscretization” is needed for dividing the resulting paths (polycurves) in equal parts (see later in this post).
The “SampleInterval” is a number that will be needed to indicated how much of the results are shown in Revit, as we don’t need to see the results for every divided piece (see later in this post).

2. Evacuation path direction

Evacuation Path Analysis - 02

The curves resulting from the Element.Geometry output from previous step are put together into one or more polycurves, using the PolyCurve.ByCurves node, which joins an unordered list of curves. This node is installed with the Ampersand package.

It’s also difficult to control the direction of each designed model line, as you might have drawn them in non-ordered way. That’s why in this part of the script the distance between the start point of each path and the location point of the exit door is evaluated. When > 500 mm, then it is assumed that the Curve.Startpoint shows the point at the other end of the polycurve. In that case the curve will be reversed.

3. Accumulated distance to the emergency exit
Evacuation Path Analysis - 03

In the third part of the script the length of the curve segments are analyzed (and they should be equal for all segments except the last one in this case), and the accumulated result is returned. This is done with the Lunchbox Mass Addition node which is available in the node library when the Lunchbox package is installed. This could be done also with the List.Scan node from the out-of-the-box Dynamo library, but this can not handle nested lists.

Finally the result is converted from mm to m (assuming that the project units are set to mm).

4. View the analysis results in Revit

Evacuation Path Analysis - 04

In this last step every n-th result (defined by the “SampleInterval” variable, defined at the front of the script) for every n-th start point of the curve is taken. Then these results are transferred to the PointAnalysisDisplay node which will generate an analysis display in the selected view in Revit.

In Revit you can view and manage the appearance of the analysis results with the “Default Analysis Display” parameter of the view. In the dataset included in this post there is already a definition made, called “Point Analysis Display”.
Evacuation Path Analysis - 06

Datasets

You can download the Revit file and Dynamo script by clicking on this link.

 

Line Of Sight Analysis with Revit and Dynamo

When a structural engineer, like me, hears or reads the word “analysis” then you will get full attention. That happened when I was discussing some architectural topics with my colleague Colin McCrone. He got my full attention, like a hypnotized patient to his shrink, when he gave me an example of “Line Of Sight Analysis”. Hah, “analysis”, that’s the magic word!

When buildings are designed, it is also necessary to think about the comfort of people living in it. And in that perspective, the line of sight is very important, if you ask me. I have been working for many years in offices: ‘landscape’ offices with no windows, offices where the sill was positioned at 1.8 m height (and this was no basement !), to office spaces with waaaaay to much windows (and thus too much sun) … Now I have my home office space (with one small window) or the airplane (with very tiny windows). So I got personally attracted by this example.

In this post I will explain you how you can analyze and visualize the line of sight of a human being in a specific room with Revit and Dynamo. As usual, at the bottom of this post you’ll find a demo video and the datasets.

Eye point

In this part of the script you select the Revit family that represents the eye point with the Select Model Element node. In the video below this is represented by a sitting man. As the FamilyInstance.Location takes the insertion point of this family we need to add the vector that points to the “eyes” of the human, which are at approximately 1.3 m here.

Dynamo Eye Sight Analysis - 01

Vector Directions

Another input we need are the vector directions of the rays. Or with other words, which are the directions the eyes will look, assuming that the head and body can turn around too of course.

Dynamo Eye Sight Analysis - 02

Ray Casting

These two inputs are then connected to the RayBounce.ByOriginDirection node. This node will send out the rays and return two outputs: points at the intersection of the ray with the first touched object in its direction and the element which is hit by the ray. The points can be used to visualize the rays with PolyCurve.ByPoints and the elements are filtered out with the Element.IsOfCategory (from the Clockwork package). In this case we need to find out which hit elements are Windows. This will define the colors of the rays.

Dynamo Eye Sight Analysis - 03

Visualization of rays

By translating the boolean results from previous step into colors, we can visualize the rays. In this case green rays hit the windows and the blue rays hit other objects. In the same way these rays are reproduced in Revit with Model Lines. The change the color of these model line, you will need the custom node Line.ColorOverride which is included in the datasets below.

Dynamo Eye Sight Analysis - 05

Dynamo Eye Sight Analysis - 04 Revit geometry in Dynamo

To interpret the results better in Dynamo you’ll need the surrounding Revit geometry. This is done simultaneously with the large group of nodes at the bottom of the script.

Dynamo Eye Sight Analysis - 06

Results

The final results look like this.

In Dynamo

Eye Sight Analysis - 04 Eye Sight Analysis - 05

In Revit

Eye Sight Analysis - 07

Special thanks to Nate Holland  and Andrew Heumann who were the initial “inspirators” for this.

Dataset

The Dynamo file and the “Sitting Man” family can be downloaded on this link.
As for the Revit file, you can simply use the “rac_advanced_sample_project.rvt” file from the Revit Sample Files.

Demo video

Radial Reinforcement in Revit with Dynamo

The modelling and detailing of reinforcement in a regular, circular floor in Revit can be done very straightforward using Path Reinforcement or by means of polar arrays.Once these circular floors have a varying thickness, and thus have a complex double curved top surface, the reinforcement modelling is best supported by using Dynamo.

In this post I will explain you how to introduce computational design for reinforcement modelling and this can be done in an easy way. At the end of the post you will be able to download the datasets and watch the instructional video.

Below you can see the circular shaped floor with an opening in the middle. The top surface of the floor has been edited with the “Modify Sub Elements” tool in Revit to get a varying thickness and to generate the double curvature of the face.

Radial reinforcement - 0

The goal is to model and detail the bottom (flat) and top (inclined) reinforcement in this floor.

With Dynamo, this whole process can be automated AND the equal rebars will be grouped in a rebar set, or the so called “Rebar Container”. By using a rebar container, the numbering and thus also the annotations can be set to a group of rebars, indicating the total amount of elements in the set of equal rebars.

Radial reinforcement - 2

Radial reinforcement - 3The applied workflow is practically the same for every “Dynamo rebar” project. You start by creating the appropriate geometry in Revit. Then you take the reference lines, faces or model in Dynamo. These references are then being used for the creation of the rebar centerlines. Therefore it is important that you re-calculate the cover from the formwork shape to the rebar centerlines by adding additional parameters (i.e. c1, c2, …like shown in the image below). Finally you create the rebar objects in the Revit model by using the “Dynamo for Rebar” package.

Radial reinforcement - 5

Radial reinforcement - 1

Datasets

The datasets that are used in the video below can be downloaded via this link.

Instructional video

If you want to learn how this is done, you can find the recorded screencast with voice-over on this link at Autodesk Knowledge Network (AKN).

Dynam(o)ite Your Design for Engineers @ AU 2015

Throughout this year I have been introducing carefully computational design with Dynamo in the world of the structural engineer. This by publishing posts on how to build up complex analysis models in Robot Structural Analysis and by reaching out to structural optimization techniques.
ES9542 - Dynam(o)ite Your Design for Engineers
In one of my classes at Autodesk University 2015, I teached some of you how to actually apply these structural optimization techniques in Dynamo and Robot Structural Analysis. Although I find this a very advanced and heavy topic, still there was a great turnout at this class, which made me really happy !

Now the year is almost over, and it’s time for you to get up and running with these techniques. As promised I would share anything about this on this blog. Now is the time. You can find a full written step-by-step handout, the presentation and lots of datasets online now. Besides that, the class is recorded. So those who couldn’t make it to Las Vegas, watch the recording and learn about Dynamo and Optimo at your won pace.

Here’s the link to the class materials : 
 ES9542 – Dynam(o)ite Your Design for Engineers

Rebar modelling in Revit with Dynamo @ AU2015

In one of my classes at Autodesk University 2015, I presented a part about how to drive Structural Rebar in Revit, applying computational design techniques with Dynamo. The workflow I applied involved MS Excel, Revit and of course Dynamo.

I recorded a small video that illustrates this workflow:

If you want to learn this yourself, then you can rewatch the AU2015 class and download all the datasets and handout by clicking the link below:

MSF11845 – Dynam(o)ite Your Design from Concept to Fabrication

Rebar modelling in Revit with Dynamo for blended shapes

Since a few weeks, the package “Dynamo for Rebar” has been released. With this package, Dynamo allows you to model Rebar objects in Autodesk Revit. This opens up a lot of opportunities for automating rebar generation, complex shape modelling and so on…

In this topic I want to explain you more about a script I made in Dynamo to generate a steel rebar cage in a blend-shaped concrete column.

    

There are a few conditions which the rebar objects need to meet in this design:

  • The longitudinal bars need to follow the inclination of the blended shape
  • The hooks at the bottom of the longitudinal rebar will different for each bar that has another inclination
  • The hooks need to point to the center of the bottom face of the column.
  • The stirrups vary in size depending on their relative height position in the column (that’s an obvious one)

    

The datasets can be downloaded here. This script is working in Revit 2016, Dynamo 0.8.2 and the package Dynamo for Rebar v1.7.

The video below shows how the script works. You will find out that it is pretty handy to use. You can also apply this script to beams with varying height, though the longitudinal rebar might be changed a bit in Dynamo to get rid of the special hooks.

If you want to see more of this into depth, then register for one of my classes on Dynamo at Autodesk University 2015 in Las Vegas:

MSF11845 – Dynam(o)ite Your Design from Concept to Fabrication
Monday, Nov 30, 2:45 PM – 3:45 PM  (Fabrication Forum)

Animated effects of time dependant harmonic loads on a building

Today, I had a very deep dive into Robot Structural Analysis, when teaching the Northern European channel partners. At a certain moment David Truyens from Datech Belgium came up with a funny video of one guy trashing his washing machine by putting bricks in it. In fact the brick causes a heavy unbalance of the machine, with disastrous consequences. Have a look at it yourself on this link. Notice the wooden pallet that supports the machine.
2

So I started thinking how this would look like on a building structure, supporting this washing machine, or something simular poking the floors of the building. I ended up building up a Time History Analysis in Autodesk Robot Structural Analysis.

The video below shows you the steps to take in order to make an animated result of the effect of a time dependant, harmonic load on the structure. The simulation is done by applying a horizontal force with a sine function over a defined time period for a frequency of 3Hz and analogue a vertical force applied with a cosine function.

Tip: While watching the last 20 seconds of the video you could listen to some music like the “Harlem shake”.

 

 

 

 

 

 

Driving a SQL database with Dynamo

Today, I decided to move on rough terrain (or at least, for me this is the case): “handling databases”. I got the question from a customer if it is possible to drive a SQL database using Dynamo and to feed the tables it with Revit data (preferable crossed data). So, I took this is as a challenge and the answer for them is: “Yes, we can ! ”

With the steps below, I would like to help you as well, setting up this workflow. The scope of the script below is dual. First I want to feed the Furniture objects in a Revit model with data coming from the Room they belong to. Secondly I want to extract all the Furniture and Room data to a MySQL database, which is located on another host machine, in this case a Virtual Machine.

Before you get started

I’ve listed some prerequisites you need to install before you can run this script, below:

  • You need to set up a MySQL server, preferable on a virtual machine or have at least the MySQL .NET Connectors installed.
  • In the video below, a MySQL viewer is used, called Workbench. You can find this viewer here.
  • You will also need a Dynamo package called Slingshot! (made by Nathan Miller, The ProvingGround.org) Read more about this package in the package manager. Slingshot! is a node library for connecting Dynamo to external Relational Database Management Systems (RDBMS).

Crossing data between Furniture and Rooms

The first requirement is to collect Room data and provide this data to the Furniture objects that belong to the appropriate Room. Therefore a custom node called “Elements in Room” is used. This node can be found in Conrad Sobon’s archi-lab.net package (Grimshaw). This custom node detects if the location point of a Furniture object is within the Room boundaries. In case of, the custom node is included in the datasets at the bottom of this message.

1 - Crossing Data

Some Rooms don’t contain Furniture and this generates empty lists in the output of this custom node. To filter that out you can perform a List.IsEmpty node on each of the sublists. This gives you at the end a filtered list of Furniture, sorted per Room and a equal list of Rooms that contains Furniture. Combine the two lists results in the values of the Room Number send back to Revit, by filling values for the RoomNr project parameter that is added to the Furniture objects in the project.

Connect to the MySQL server

Before feeding data from the Revit model into the MySQL database, we need to make a connection between Dynamo and the server. This can be executed using the following Slingshot! nodes:

  • Connection.MySQL_ConnectionString : generates the connection string using the input data from the Code Block on the left
  • A Code Block containing the command string for creating a new database. This code block is driven by a variable called “Schema”
  • Command.MySQL_Command : this will send the command to the MySQL server, indicated in the ConnectionString. The result is a boolean which indicates if the “schema” or “database” is created.

2 - Connect to MySQL

Create tables in the MySQL database

The Revit data needs to be extracted to several tables. One for the Furniture and one for the Rooms. With Dynamo and Slingshot! it is possible to define these tables with the specific columns. In this case, I did this using a code block to send the command string the MySQL server. (This string is in fact a copy past from the MySQL command prompt, when creating tables using the Workbench viewer).

//Syntax for command to create the Room table with indicated columns
“CREATE TABLE `” + DBase + “`.`” + Table + “` (
`ROOM_ID` INT NOT NULL COMMENT ”,
`NUMBER` VARCHAR(45) NULL COMMENT ”,
`NAME` VARCHAR(45) NULL COMMENT ”,
`AREA` DOUBLE NULL COMMENT ”,
PRIMARY KEY (`ROOM_ID`)  COMMENT ”)”;

3 - Create tables

Feeding the MySQL database with data from Revit

In this part of the script I will extract the data from the Furniture and Room instances and feed them in the right tables of the database. The Revit ID of each object is unique and will be used as Primary Key in the database. On top of that, the Revit ID of the Rooms, the Furniture instances belong to, will be written into the Furniture table as well. This value can be used later to make queries across the tables.

Below is shown how to collect the Furniture data and send them to the SQL.InsertInto node. This last node generates the command strings for the input of data in the database. The Table input of this node is a concatenated string of the database name and table name, which is here “MillenniumRail.Furniture”

4 - Collecting Furniture data

In the next image, similar is done for the collection of Room data.

5 - Collecting Room data

When all data is collected and the strings are generated, we can send them to the Command.MySQL_Command in order to connect to the database and write the values. This is done in one time for Furniture and Rooms using a List.Join (which joins the SQL.InsertInto output from Room and Furniture instances.

6 - Write to SQL

Change data in the MySQL database

Using the MySQL Workbench you can change the data within the database. In this case, the values of the Furniture marks are added to the table.

8 - SQL Viewer

Read data from the MySQL database

The changes that have been executed in the database, can be read in Dynamo and can be transferred back to Revit if necessary. Below you can find the statement that is needed to read data with the Query.MySQL_Query node. This is basically the same as the prompt command in MySQL: “SELECT * FROM millenniumrail.furniture”

7 - Query SQL

Datasets & Video

You can download the Dynamo dataset below . Before you run the script be sure that you have:

  • Added a (project) parameter called “RoomNr” to the Furniture objects (or change the parameter name in Dynamo)
  • an active connection to your MySQL server
  • installed Slingshot! package.

Download dataset

This video shows quickly how it works:

Special thanks to my colleague Ives Veelaert, with helping me out when having problems connecting with the VM SQL Server.