Revit to Excel With Included Column Headers Using Dynamo

I recently received a follow up question to my Revit to Excel Dynamo post asking how to add header to the exported Excel file.

…when the data is extracted to excel is it possible to have the parameters come across and act as headers within the excel document? Is there a process with Dynamo to do this?

I’d never actually looked into how to do it, but it’s a good question for sure. I had a look around the web and there were plenty of solutions that didn’t really seem to work, or to me seemed to be far more cumbersome than they needed to be. This is the second iteration of my solution, which is far more streamlined than what I came up with initially yet achieves the same results.

revised hedaer list

Coming in on the left hand side of the image is the strings defining the parameter names from my Revit to Excel Dynamo post feeding into a List.Create node. I’ve added the additional string GUID string feed into index0 as in the previous example I didn’t need to define the GUID string. The Flatten node that you can see is fed by the List.Create node from the Revit to Excel Dynamo post that builds up the list of parameters to export.

Next comes a simple code block where I have entered the code {list1,list2}; Simply wire up each list in the order you want them to join in and then finally, feed the code block into the data port of the Excel.WriteToFile node.

On the way back in it’s just as simple, I’ve used List.Deconstruct to drop the first row of the list, which is our headers. I’ve then used Flatten to convert the list to a usable format so we can pull the data for each family, the rest is exactly the same as before.

One thought on “Revit to Excel With Included Column Headers Using Dynamo

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: