Exporting Rebar schedules to excel

Hi everybody,

I am working on a way to export our rebar schedules from Revit to excel. I have come a decent way but am stuck right now trying to get some functionalities, which I can’t get to work.

The idea is the following:
In revit we have three schedules corresponding to a plan. This is due to the workings of the internal workflow. Each plan has a code (010, 020, 030, …) that is added as a prefix to the schedule names. For plan 010 this would be:

“010(1) - description” (this is a Detail Item schedule)
“010(2) - description” (this is a Structural Rebar schedule)
“010(n) - description” (this is an Area reinforcement schedule)

What I have achieved:

I have managed to get the Dynamo script to export the data to an excel file, where every schedule is exported to a different sheet. The shape images are exported as text.

What I want to achieve:

I want to export all of the data that corresponds to a certain plan to be exported on the same sheet (so for example all the data of the three schedules for plan 010 to be exported to a sheet called “010”).

I have managed to group the schedules that correspond to the same plan in sublists by getting the code from the schedule names using String.Substring, and then using List.GroupByKey with the substring output as the keys.

The point where I fail is that if I try to export the data from the three schedules to the same sheet in excel, it overwrites the data of the three schedules on top of each other, instead of exporting them underneath each other. I have tried tinkering with the levels and lacing to reslove this, but I have not managed to find any succes.

I am also trying to find a way to export the shape images as images in excel, but without much succes.
I have added the Dynamo script, along with a sample project to run it on, and the excel that the script exports in the wetransfer below (files were too large for direct upload here).

Anybody who has an idea? :slight_smile: