Room name in floor parameter

rooms
revit
dynamo
#1

Hey there!
How do I obtain the room number where a floor resides in and write it in a floor instance parameter?
I think I kinda figured it out but I don’t know how to write multiple room numbers when the same floor instance is on different rooms.

#2

I think you have to flatten the list of “Manage.ReplaceNulls” then you have to get index of none item on it by node “List.All indices of” to exclude them from list of node “Room Number” then apply the result of the previous process to the last node “element.setparameterbyname”.

#3

ok but the problem is that I don’t know how to associate the floor to the room(s) where it resides.
I tried to use FamilyInstance.Room but it doesn’ work with floors

#4

What about this?

#5

The real problem here is that the “Room” parameter into the floor family instance it’s always overwritten for every Room that resides on the floor.
If I have multiple rooms on the same floor instance Dynamo compiles the “Room” parameter just with the last room name, even if the parameter type is a multi-line text

#6

#7

#8

That’s how setting parameters works when you try to set the same parameter multiple times, it only keeps the last one. What you want is to find all of the rooms that each floor is on, combine it into a single string (either using commas or new lines) and then set the parameter just once for each floor.

Instead of finding which floors are in which room, try doing the opposite. Find which rooms are on each floor. Then combine the names into a single string and then set it.

#9

Exactly! But how I do that? I’ve done the very same thing with furniture using FamilyInstance.Room but it just doesn’t work with floors

(The parameter is correctly compiled, the warnings are about the nulls values but they can easily be replaced)

#10

Is there a method to workaround this type of error?