Autodesk Revit, Dynamo and Microsoft Excel for Drawing Sheet Creation

When Dynamo was first released for Autodesk Revit I assumed that this would just be used for computational geometry and complex architectural forms. However, I recently took a deeper look into Dynamo and started to realise that this has many uses for the everyday management of models, manipulation of data and the automation of typical time consuming tasks.

Dynamo Program and Revit Browser
I have created a small Dynamo program to create drawing sheets by reading data from an Excel Sheet and also generate parameters for each view to aid the view categorisation.  I was surprised at how quickly this visual ‘code’ came together! Let’s take a look at the process from the start.

First you need to make sure that you have Dynamo installed, this is installed automatically with Revit 2015 R2 and Revit 2016 but can be installed separately for older releases. The versions are changing very rapidly so in this tutorial I am using Dynamo V0.8.

In the future I can see Dynamo appearing in many other Autodesk applications as it has a very flexible and intuitive interface for the average Revit user that is not a coding expert.

Let’s now look at the steps required to create this visual application. This of course can be scaled up to meet more demanding procedures as required!

  1. Start a new Revit Project and then launch Dynamo from the Add-Ins Ribbon as shown below.Dynamo V0.8 Icon
  2. Start Microsoft Excel and create a document that contains the following columns, you can of course use your own names, numbers etc. Microsoft Excel is particularly good for this type of work as the drawing number can be created from specific entries in other columns.Microsoft Excel for Drawing Numbers
  3. Next you rename the Excel sheet to the following. Save the Excel file in a location of your choice.

Microsoft Excel Tabs

4. Switch to Dynamo and start a new Dynamo File.

Dynamo Application

5. You will now see the main Dynamo interface. The Dynamo application is split between     the node library on the left and the Workspace on the right. You will also notice that           Dynamo has a search function at the top of the node library for locating specific nodes.     Note that older versions of Dynamo may not display icons.

Dynamo Application screen

Start by searching for the File Path node as shown below.

Dynamo - File path Node

Click the File Path node once and it will be added to your workspace. The workspace can be zoomed and panned in the same way as Revit and you can drag the node to any location within the workspace.

Click the Browse button and locate your Microsoft Excel file. This node will allow you to select any type of file on your PC.

Dynamo - Browse

6. Next you add File from Path node. This should appear in the node library as it contains      the File Path search string. Click this node to add it to the workspace.

Dynamo - File from path Node

Next you ‘wire’ the nodes together as shown below. This is the primary method of building a visual program within Dynamo. At any time you can select the small grey square below the file node to display a watch window to show the current output.

Dynamo - Wire Nodes Together

7.  Using a similar process you can search for the Excel nodes and add                           Excel.ReadFromFile and a String Node. These should look like the following as shown below. The String entry is used to select the correct sheet in Microsoft Excel, in our case we named it ‘DRAWING NUMBERS’. Note the Watch window now shows the data from the Excel File. If any boxes show in Yellow then there is an error in your inputs.

Read Excel File Dynamo

8. Next we need to split the data into separate columns from the list. Note that the watch window shows [0], [1] and [2]. These are the column headers in Excel.

9. Type List.Transpose in the Search nodes and then add this to the workspace. Wire the Var[][] node to the List node. You then search and add a Number node and also the List.GetItemAtIndex.

Wire these together as shown below. Again click the grey Square box to show a Watch window of the data. Notice that this is now reading the first column of the Excel Sheet.

Dynamo - List.GetItemAtIndex

10. You then repeat this process to create three separate lists. Note that you can copy and paste the nodes for speed. Select the nodes with the Ctrl Key and then Ctrl-C and Ctrl-V and then rewire. Your workspace should now look similar to the below image.

Dynamo - List.GetItemAtIndex Copy and Paste

11. Next we create a new node to create the drawing sheets in your Revit project. In the search field type ‘Sheet By Name’ and then add the ‘ByNameNumberTitleblockAndView’ node to your workspace. You can then wire the Sheet Name and Sheet Number and connect these to the relevant lists as shown below.

Dynamo - Sheet By Name

12. The next step is to tell the node what titleblock to use. In this example we will use the default A1 Metric title block. Type ‘Family Types’ into the node search and add this to the work space. Also search for ‘Views’ and add this to the workspace as shown below. You can of course use your own settings for the title block and view. In this example I have used the North Elevation for the first view and A1 metric for the Title Block.

Dynamo - Create Sheets

That should be your code. The Running of this code is probably set to Automatic by default but you can select run in the bottom left of the Dynamo interface as shown below.

Dynamo - Run

I hope that this has shown how useful and simple Dynamo can be for automation of tedious operations. I will showcase some more uses for Dynamo in future tutorials.

LawrenceH

22 thoughts on “Autodesk Revit, Dynamo and Microsoft Excel for Drawing Sheet Creation

  1. Hi Lawrence,

    Great post as always. Your example is my first attempt at using Dynamo. Amazed how simple and efficient it was. If I wanted to generate an issue sheet in excel from the Sheets created in Revit, would if be as simple as switching the process around?

    Regards, Lee

  2. Could solw my problem, Im trying achiev algorytm with several TitleBlock according to value in XLS (A1,A3,A4)

    In xls – A1 then take TitleBlock A1xyz
    In xls – A2 then take TitleBlock A2xyz

  3. For anyone wondering what to do with the third column of information (browser organization), you will first have to know what parameter holds that information in your project. (Look at your Browser Organization for Sheets; use the Edit button to open the Browser Organization Properties and select the Grouping and Sorting tab.) Knowing that, you can add an Element.SetParameterByName node to your Dynamo graph. Take the output of the Sheet.ByNameNumberTitleBlockAndView node and feed it to the element input. Add a String node, enter the name of your parameter, and connect that to the parameterName input. Finally, connect the output of the List.GetItemAtIndex node for Index 2 to the value input.

    When you run the graph, it will generate the sheets and add the parameter values, so the sheets will appear in the correct spot in your Project Browser. If you have multiple sorting parameters (we have two), you can add the values for each additional sorting parameter to additional columns in your Excel sheet and add a List.GetItemAtIndex node (with a Number node for each additional column) and an Element.SetParameterByName node (with a String node with the associated parameter name) for each column added.

    1. I have set the parameter. I’m wondering why it doesn’t sort the drawings according to series of drawings. I only got 1 subfolder then all the drawings are inside that created folder and not sort out. Please help

  4. Hi there.
    Let’s suppose an instance of “Floor: Structural” (Revit 2016) of type “Generic Floor – 400”. The thickness of this structural floor is automatically set by its type (400mm). This property is composed by a layer of materials. On editing Generic Floor – 400mm type, press Edit… on Construction/Structure and then you’ll see the definition of each layer.
    The question is: how to achieve each of those layers within Dynamo in order to chance it?
    Someone to help? Thanks a lot.

  5. I installed first Revit 2016, then installed Dynamo Studio 2016. But in Revit I do not have a Dynamo add-in. So I cannot link Dynamo and Revit. Do you know how do I do this or have a link to solve the problem? Thanks.

      1. It worked. I installed Dynamo 0.8.2 and it´s free. But I don’t know why Autodesk launched Dynamo Studio (a pay software) and it doesn’t appear to work linked to Revit. Maybe it’s intended for stand-alone use only.

        Most of your post are really great!!

  6. Hi Gerardo,

    You are correct that Dynamo Studio has been released for users that have not got access to Revit but may want to create graphs for computational structures and geometry, Revit users will get Dynamo free as the add in that you see.

    LawrenceH

  7. I appreciate this is an old post so my comments may not be seen, however firstly, great tutorial. I’m new to Dynamo but in simple terms providing there is a matching parameter reference name across both tools then that data should be “exchangable”? The reason I ask is that I’d like to expand on this particular idea by allowing the creation of drawing sheets to align with BS1192:2007 file numbering. The idea being that Revit users would create drawing sheets using a series of drop down menus in excel which would then report back to Revit as per your tutorial, difference being the “drawing number” would be split into several parameters rather than one generic drawing number : originator, volume, level, type, role and number.

    1. Hi Stephen,

      You are correct that Dynamo can write any data from rows and columns to any parameter that you choose. This is the interesting part for me, it’s all about the i in BIM and Dynamo is very good at quickly populating this data into a model.

      1. Great, thanks for replying. In relation to use of the sheet creation tool, is it reliant on a Dynamo installation per Revit user or is the connection made by the programming itself. Thinking ahead to the potential for company wide user creation of sheets but not wanting a reliance on Dynamo. Also is the sheet creation tool easy to add to without additional programming..i.e just add the additional sheets required at that time to the excel document and “run”.

  8. Which Excel version do you use? Can not get it to work. I use 2007 dutch. With an csv file it works fine.

  9. I appreciate for your very easy guide and I did my 1st Dynamo trial on your posting.
    By the way if the result this practice should be sheets created by dynamo and a sheet includes an appointed view(“North” in the post) my trial has`t been successful.
    I have a question for that my dynamo (actually me) couldn`t get the view into the sheet. let me send Workspace shot to your email.
    If you are fine I would seek your reply.

    Thank you. Lawrenceeh

Leave a comment