Dynamo Script to write area to Excel by room name

Hello - I am wondering if anyone can help me out with this. I am new to Dynamo, and can’t figure this routine out past a certain point. I am trying to automate Revit room areas to Excel by their department (which can be summarized by their room name). I am working on an apartment project, and want to be able to have Dynamo write to Excel a list showing each department (1 BR, 2 BR, service, etc.) - by floor - with a total area by department. And then (ideally) total them. Such as,

Second Floor
1 BR - 2,567 SF
2 BR - 8,070 SF
3 BR - 4,121 SF
Corridors - 3,500 SF
Total - 18,258 SF

I’ve attached a Dynamo routine where I have extracted all the rooms by level, and sorted some of their parameters, such as Name, Number, Area. But my list filtering skills are rudimentary at best . . . is there a way to extract the rooms by level, then by department, then get their areas and total them?
Steve B.

Rooms to Excel-01.dyn (18.2 KB)


This might help


This should get you started. You will need to change the python script to suit the names of departments and levels in your project. If you provide the project here maybe I could look into that.

filtering rooms by department and level.dyn (14.3 KB)

Thanks! I’ll check it out

Thanks, Marcel - I will check out this video as soon as I can.

Simon - I’m not sure how to change the Python Script to suit. I have attached a simple Revit project with some rooms/departments on Levels 1 & 2. How would I take it farther with this?
SteveSample-01.rvt (1.5 MB)

This should get you started. You will need to add more get_item_at_index nodes to get all of the different rooms.

filtering rooms by department and level # 2.dyn (34.8 KB)

Simon - I adjusted and ran the latest script you posted. I think I can figure out how to edit the Python scripts included as needed. But how do I carry this thru to calculate the areas of each department by floor? I now end up with a list with the same department, can I now get a room area for that list? The list I end up with seems to be just a list of names (Like “Practice”).

This is as far as I can take it without just doing the whole thing. You should be able to figure out the rest of it. If not maybe take a look at some Lynda.com tutorials.

filtering rooms by department and level # 3.dyn (45.4 KB)

OK - thanks for the help, good start for me.

Hello - Maybe one more hint? When I run your script, it separates the rooms into their different departments, but at the end it produces a list of department names (like “Sound Room” or “Practice”). Isn’t this just a list of names, with the indexing no longer attached to a room? Or is there a way to then tie this back into the room (and its area)?
I have also attached another (#3) where I added some nodes at the top (in orange) that take what you’ve started, and produce a list of room with their dept. names and areas. Not sure if this helps, though.
Thanks again.
Stevefiltering rooms by department and level # 3.dyn (43.3 KB)

The output of the python node are the rooms.

OK, thanks