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.


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 (
  • Ampersand


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 ( 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


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


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.


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


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).

Classes at Autodesk University 2015 are online

It’s been a more than a week already again, since Autodesk University 2015 closed with a great keynote and a big party. I hope you enjoyed it as much as I did. But there are also a lot who could not attend this great conference. Well, good news if you are one of them. Lots of classes got (video)recorded.


These recordings can now be found online in the AU Online class catalog. Also the 3 classes that I teached are available, including the handouts, presentations and extensive datasets.

You can find a direct link to the recording and downloads below:

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

ES9542: Dynam(o)ite Your Design for Engineers

ES9599: Involve Analysis from Predesign Through to Documentation Phase in Your BIM Process

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.

 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

React Structures embraces Dynamo

This week a new update of the Technology Preview of Autodesk React Structures was announced (read more here), better known as React Structures TP 2.

In this new release it is, besides the usage of metric units, also possible to connect your Dynamo scripts with your React Structures analysis model.

I used one of the scripts that I will present at AU 2015 in the “Dynam(o)ite Your Design for Engineers” class and used it without any modification in React Structures.

All the datasets, handouts and presentations that will help you to perform this yourself, will be posted on the AU class catalog, as well as on this blog after AU. So, keep on eye on it within the next few weeks.

The next video shows the results of this small operation.




Automatic Element View Generation in Revit with Dynamo

During this really busy period and in between lots of preparation work for my Autodesk University 2015 classes, I finally found some time to explain you how Dynamo can help you automate the generation of section views based on the element selection in Revit. I must admit, this is part of my preparation too. So yes, I will explain this more in depth at AU 2015 !

When making detailed (fabrication) drawings of your reinforced concrete design model, you need to make a lot of section views in order to document the element geometry and rebar detailing. You might need some automation of these views to save a lot of your time. Especially when it comes to lots of objects, that need the same type of views (top view, front view, cross section view). With than in mind, I started to explore this in Dynamo and created a procedure to generate these types of views based on the element linear direction.

The whole dataset can be downloaded at the bottom of this article. By the end of this article you will be able to create automated views like in the screen shot below. The script works not only on straight elements, but also on rotated columns (C2, C3), slanted columns (C4) and inclined beams (B5). In case of section views that are not parallel with the level plan view, they are not shown in the view, but they are still created (as you can see in the Sections list).



Below you can see a video on how the script executes and reacts on changes made on the Revit objects.

The script consists of several parts (indicated by the groups) and there is some custom nodes that you will need in order to create the views. Let’s start with it:

Element Configurations

The challenge for this script is to be able of handling several element configurations, from straight beams and columns, to rotated, inclined or slanted beams and columns.


Location line of selected elements

As basic input the script needs model geometry and a line indicating the “length axis” of the object. This is needed for the orientation of all the views. This length axis can either be the location line of a beam, or a manual selected edge, or a global indicated axis. In this case, the location line is the driving factor behind the sections.

In case of “Structural Framing” objects this can be done with the StructuralFraming.Location node. This node will return the Location Line as modelled in Revit. In this case the start-end direction of a beam is very important to define the section length direction.


In case of “Structural Column” it is not that simple. I got inspired for this one by a post by Marcello Sgambelluri about the location line of structural columns. By searching for the Vertex.PointGeometry of the faces of the column geometry, and by getting the Line.ByBestFitThroughPoints on these points, you get in fact the location line of the column. The reason for using this method is because vertical columns only return a “Location point” in the Revit API, while slanted columns have a “Location line” returned. The method applied here helps to get the location line in all cases.


Vector definition for section direction

The most important part of the script is the definition of the vectors along and on the location lines. These vectors are crucial for the definition of the section direction and for the detection of the “bounding” surface. See later in this post. There is a small difference in the detection of the vectors for beams and columns.

In the top part of the script, the vectors for the structural framing elements are defined. The next steps are executed for this:


Step 1 – Location line

In step 1, the output port of the StructuralFraming.LocationLine node is connected in a way that the user has the option to reverse the curve yes or no, but playing with the Boolean node. This has an influence on the section direction later on when generating the views in Revit.


Step 2 – Length axis direction

The Line.Direction node, returns the direction vector of the location line that results from the If node (reversed or not). This is the local x-axis of the element. This vector will be used for top and front views of the element and defines the 1st dimension of the section view crop region.

Step 3 – Local y-axis

We also need the local y-axis of the linear element, to help define the 2nd dimension of the section view crop region for the Top view and the Cross Section view in combination with the result from Step 4. The Curve.NormalAtParameter node positioned at the start of the line defines the vector perpendicular on the Line.Direction

Step 4 – Local z-axis

Finally the local z-axis is also needed. This axis will define the 2nd dimension of the section view crop region for the Front view and the Cross Section view in combination with the result from Step 3. To get this vector the result from Curve.NormalAtParameter node is rotated 90° around the length axis of the element.

The bottom part of the script uses a more extended method to define the local axes of the structural column. Follow the steps below:


For a structural column Step 1, 2 and 4 are the same as for structural framing. But Step 3 is different. Read below why.

Step 3 – Local y-axis with angle correction

The definition of the local y-axis of a structural column is not done by just detecting the ‘Normal’ vector. A vertical column with a cross-section rotation, returns the same location line than a column without rotation, and thus the same normal vector. This means we need to correct the normal vector by rotating the normal vector with the same angle as the column rotation, if we want the section views to be aligned to the column faces.

With the custom node Element.RotationAngle (which is also included in the dataset at the bottom of this article) you can detect the rotation angle of vertical columns. In the custom node, a Python node is used to read the rotation angle from the Revit API. Important here is that the cross-section rotation angle of slanted columns can’t be detected here and the node returns “null”. This null value is replaced by a zero value. This is not causing problems, as the Curve.NormalAtParameter node working on the location line of a slanted column, returns the vector aligned with the local y-axis of the column, and thus doesn’t need angle correction.

The result is used to define the 2nd dimension of the section view crop region for the Top view and the Cross Section view in combination with the result from Step 4.

Vector and element collection

The collection of the information of vectors, elements and view names is the last part before the section generation is executed. The information is collected with the List.Create node and then transposed with List.Transpose to finally be send in a flattened array to the custom Element View Creation node.

In (1) the vectors for the X-axis of the section are collected and similar is done for the Y-axis of the section.

The combination of these lists will results in the next sections in case of structural framing

Index 0 : X = length axis, Y = normal vector -> Front view
Index 1 : X = normal vector, Y = rotated normal vector -> Cross Section view
Index 2: X = length axis, Y = rotated normal vector -> Top (Side) view

In (2) the number of section view types are calculated. In this case we want 3 different views. For the ease of lacing of the Revit elements in the Element View Creation node, we will cycle the elements until 3 times (repeating).


Finally the view names need to be unique and so we will make a view name with a static part (Top, Front, Side, …) and a unique parameter of the element.
In this case the value of the “Mark” parameter within Revit is used.


Element view creation

All the datacollections for vectors, Revit elements and view names are joined with List.Join and send to the custom node Create Element View (which is also included in the dataset at the bottom of this article). Let me explain you how this custom node works below.


The goal of the custom node is to define a section view that is aligned to the boundaries of the element, whether it is a horizontal, vertical, inclined, rotated, slanted, … element. The Front, Top and Side view should follow the length axis, and the Cross section should be perpendicular.

The Revit nodes in Dynamo offer a specific node for that, called SectionView.ByCoordinateSystemMinPointMaxPoint. The inputs that we need here are:
– The coordinate system in which the section view should act (i.e. a coordinates system where x aligns with the element length, y with the normal vector, will return a section as a Top view on the element. Z = the section view depth)
– minPoint / maxPoint : these are coordinate values of the points in accordance to the local cs, which will define the crop region and view depth of the section view.

The custom node will calculate these input values from the element selection and defined vectors. If you open the custom node, by double clicking it, then you will see the script as explained below.

Step 1 – Input values

The first part of the custom node is the collection of the input values.


The Element.Geometry returns the solid geometry of the elements. Below an example of the structural framings with the location line and the solid geometry visible.


Step 2 – Coordinate System and Workplanes

The custom node will generate views that are aligned to the Solid.Centroid of the Revit Element.Geometry. Crucial in here is the definition of the CoordinateSystem.ByOriginVectors on that point and the input of the previously defined xAxis and yAxis. This will be the basis of the section direction.

Additionally the same input values are used to create a plane on the centroid. This plane will be used in Step 3, to generate the section crop region boundaries.


Step 3 – Definition of the section view crop region boundaries

In this step of the custom node, the section boundaries are defined.


(1) The Geometry.Intersect generates a surface as a result of the intersection of the Element.Geometry and the Plane.ByOriginXaxisYaxis. The last one was defined in step 2, according to the vectors along and on the location line of the element. When you would unpack the custom node, and run it as a project, then these surfaces as shown below would be the result.


(2) The countour curves of these surfaces are detected, in order to offset them according the CropRegionOffset input variable. The offset is executed with positive and negative value. This is to take into account possible different offset directions, depending on the way the Revit family has been built up.
We only want the outside offset contour, but that could be generated by the “–x” value in some cases.

(3) When the offset returns a closed curve with zero-length (ie in case of a negative offset that is greater than the smallest cross distance in the original closed curve), it is filtered out with the List.FilterByBoolMask node.

(4) As we now have two closed curves generated by the Curve.Offset node, we have to detect the outer one. This can be easily done by searching for the closed curve with the biggest length, which is done here with the MaximumItemByKey function on the nested list. (Thanks to Dimitar Venkov for the tip). The outer offset contour is indicated in blue in the next image.


(5) Because we need the Curve.Startpoint of each segment of these contour lines, we need to explode the closed polycurve (which acts as a single object) into single curves again. The result of Curve.Startpoint is used then to define the minPoint and maxPoint of the section view node.

Step 4 – Definition of minPoint / maxPoint

Once we have the corner points of the section boundary lines, we need to calculate their coordinates according to the local coordinate system of the element, formed by the centroid and the previously defined x- and y-vectors. Therefore we need to translate the Curve.Startpoint geometry from Step 3 (5) from the LCS (see step 2) to the WCS, indicated by the CoordinateSystem.Identity node. This will return new points in the WCS. From these points extract the maximum and minimum X- and Y-coordinate. These will be used in the final step 5.


Step 5 – Section view creation

In this last step of the custom node, the coordinatesystem, minPoint and maxPoint are used for the section creation and the view is instantly renamed to the required one, defined in earlier in the main workspace.


(1) The calculated local coordinates in step 4 are connected with Point.ByCoordinates nodes. The top one is used for the minimal X-Y coordinates, the bottom one for the maximal values.

(2) The CropRegionOffset is used to set the Z-value of the minPoint. This will define the position of the section line in Revit in accordance to the centroid of the solid. The ViewDepth value results in the “Far Clip Offset” parameter in Revit. But for the SectionView creation we need the absolute Z-value, which is recalculated here by subtracting the CropRegionOffset in order to have the distance of maxPoint.Z to the centroid point.

SectionView.ByCoordinateSystemMinPointMaxPoint is the magic node that generates the section views with all the calculations that are made before.

(4) The finishing touch is to rename the automatic created section into some logical name (ie. “Front – B4”).


The whole dataset can be downloaded here.

At the moment it is only implemented for columns and beams. Walls should be implemented very soon. But please, feel free to give any suggestions !

I hope you enjoy it !

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)