How to create multiple Worksheets in an Excel file

Good morning everyone,

I am background opening a bunch of Revit families to extract some information from them to write to Excel. I’ve got this working well.
I am searching folders on my PC which means there will always be a warrying number of families in each folder.
What I am trying to do is take the family type name (Which I have in Dynamo), and create Worksheets for each family type name and write the relevant information to each tab.
Can anyone tell me if this is possible? I know it’s possible to create multiple worksheets by writing the information out specifically, such as “Worksheet”, “Origin”, “Data” etc.
But since this is going to be changing all the time, how would I handle that?
image
I thought this node from Bumblebee would be able to help, but it looks like it queries the existing worksheet names rather than creating them?
Any help would be appreciated.
Thnaks!

Group your data by family type name and when you export to excel, connect family names as “Sheetname” and data in correct levels.

Hi Deniz,

I did manage to figure it out thanks, just having some issues with my list levels, not sure how to get them to where I want them to be, but I will keep playing.
Thanks for the response.

1 Like

I am sure you fill find a solution there :slight_smile: keep trying!

1 Like

Hi Deniz,

Got my list structures the way that I want them :slight_smile:
I wonder if you could offer some advice in terms of what this script is looking for now?

I am feeding in a list of family documents that I receive from a folder selection process, then I sometimes get this error, but not always. I put a “Start Transaction” node before because I thought that is what it was asking for, now I am not sure?
Could you offer some assistance here?

You should also feed in Node FamilyType.Create the family name. That is why you get that error :slight_smile:

Feed in the type name like this?

I don’t always need to do this though, sometimes it works without feeding in anything into the “Name” input.

Which family types you want to create?
Hint: Family types will store in family document. Do you want to new types of AHU_Coil Cooling for example? then give it new names.

I’m not really sure if I want new types or not. I just need a family type to feed into the “Parameter.GetValue” node from Orchid. I’m just looking for parameter extraction here, I don’t want to do anything with physical element creation or anything like that. This is just for parameter Extraction to excel.

Show please the whole graph in order to see what you have done.

Hi Deniz,

Here is the DYN file, I hope it makes sense
Get parameters and write to excel_Bumblebee_adding items before list create.dyn (163.1 KB)

Hi Deniz,

Have you had a chance to look at this yet? I am still getting the error from the FamilyType.Create node which says “A sub-transaction can only be active inside an open transaction”

FamilyTypes.Create node create a new type of family. So you don’t need it. If you want to check its family types use that node:

1 Like

Thank you Deniz that worked!

I was under the assumption that the family type input from the “Parameter.GetValue” node was compulsory, I didn’t check that.

Thanks for your help!

1 Like