Dynamo, Revit, Excel, UI...what a wonderful day!
Today I'll show you two examples of how to use Dynamo to export existing Revit schedules and how to compose a custom schedule on the fly, to be exported to Excel.
Both of them with a very nice graphical user interface thanks to Data-Shapes (https://data-shapes.net/) package.
Let's start from the easier. The idea behind this script is to export a list of existing schedules to an Excel file, creating for each schedule a separate tab.
To be able to complete this script you'll need two packages:
- Data-Shapes for the graphical interfaces
- BimorphNodes to extract schedules data
The script is very easy and you have to focus only on how to create an interface
Then you can use your input to feed the next nodes.
So just push the run button (or use Dynamo Player is you are in Revit 2017.1 or 2017.2) and enjoy the interface.
Export parameters to Excel
In the second script I'll focus on something more interesting. Many times we need to just extract a list of elements in a specific category and we need to extract that damned parameter that is there but that you can't place in a schedule, simple exaple, the Level or the Offset for a Duct! :@
Ok, Dynamo can do this but you've to know the name of the parameter, you've to create a new script and you've to know Dynamo!
This script is exactly for those who don't know Dynamo and for lazy people, like me.
So let's start as always from the interface. This time I want to build an interface able to understand if a category is empty or not and, if the category is empty, produce an alarm and, if the category is not empty, list all the parameters related to that specific category.
First step create the interface to list all categories. As always with Data-Shapes nodes.
Now a very nice trick...if the first interface node is False, the count of element is 0 and only if the first interface is on true, it will count the number of elements ;)
I know sometimes I'm crazy but you like this if you're a Dynamo addicted!
Anyway, let's continue. So now we selected one category and we have elements in this category, we have to build a new interface based on this.
And finally export the values extracted for the selected parameters to an Excel file
But what if you don't have elements in the category? Easy you just inform the user!
I love this!
So let's see the script in action
And this is if the category is empty
For the export parameters script, if you choose and empty category and empty excel will be opened and saved automatically in your document folder, just delete it!
Rememeber to choose an image as a logo...and enjoy!
The original post may be found on the BIM and Other blog.
Dynamo is brought to you by Autodesk. Dynamo for Revit is free.
This add-in is compatible with Revit 2017, 2016, and 2015.
There's more information available on the Dynamo website.