In this post I will present a quick workflow for getting new sheets into Revit using an Excel spreadsheet. You will ask me: Why in the world would you do that? My answer is that sometimes you have a consultant on a project that works exclusively in AutoCAD (yeah that evil sucker still exists), and you somehow need to get their drawings to show up on a drawing list. In order to do that you need to create placeholder sheets or real sheets if you actually want to assign some properties to them (like I do). So the idea is to get all of these sheets created in less than 10min instead of hours of manual labor (I have been there), and if they send you a new Excel spreadsheet with updated list, get only the new ones in and skip all that already exist. Let’s start with getting the excel into Dynamo:
1. Import an Excel Spreadsheet into Dynamo and extract only two columns of information (sheet number and name):
Once we have our Excel data parsed we need to determine if sheets already exist in the model or not. I am using a custom Python node for that because when I first wrote it removing white space characters from strings was not available. I think this can be done using Dynamo standard nodes in version 0.7.1. Anyways, here’s the code that will compare sheet numbers from Excel with those already in project to determine if sheets need to be added:
The output of this node will be two lists. One will contain only sheet numbers for new sheets and another only sheet names. Next step is to use that information to create sheets. In order to create them we will need one more piece of information: a Titleblock Type ElementId. Simply use Family Types and ElementId nodes to obtain that:
Now, this part was not mandatory to create the sheet. All we need for a new sheet is really just an Active Document and a Titleblock Type Id (then we assign them Number and Name but Revit will automatically assign a Number on creation and Name as “Unnamed” so technically you only need Document and Id), but I also wanted to make sure that my new sheets get sorted and filtered properly in my Drawing List so I decided to set a few parameters while I was on it. Again this part could be done later using Dynamo nodes, but I figured I will wrap it all up in one transaction which probably makes it faster (not entirely sure). Here it is:
And here’s a Python code for the last custom node:
Again, that last part can be done in Dynamo without use of Python and i will be more than happy to demonstrate that one day, it’s just that today I am posting how I have been using it for a while so its proven to work.
Good luck! Use it if you like but please give credit where credit us due.
Here’s a preview on YouTube:
Here’s code mentioned below in the comments that takes only input of names and numbers for the sheets. Please use the View Raw button in the bottom right corner to see the raw code (best for copy/paste):