Sort Rooms list by separate list of room numbers

I have a list of room numbers, I need to get a list of rooms in the order of the room number list. NOT in order of room number. Specifically in the order of a list of room numbers (may not be sequential).

Thanks!

What methods have you attempted, and what format are you planning to provide the template list?

Can you share what you have built as a graph and any images so we can better assist you?

Certainly. Sorry, I didn’t include what I have because I really don’t have any attempt at what I’m asking how to do simply because I don’t know how to do it.

Here’s what I do have. I am using BiMorph package to get the list of room numbers in the order they appear on a schedule. Also a list of room occupancies.

I have previously sorted a list of rooms by level and by number, the way our schedule is sorting them. This worked great until I realized the schedule is sorting the levels by height and Dynamo is sorting alphabetically. Obviously, this throws everything off.

So, now I have the room numbers in the order I need (the list derived in the Filter to Remove Tally Rows (Room Number) group), but I need the Room element list in that same order so I can apply the occupancies to the rooms. That’s where my limited knowledge of Dynamo fails me.

I figure there has to be some way to take each room number and make a list of Room elements by grabbing the room that matches the room number in the list. Loop through the room number list and create a new list of Room elements, basically.

Thanks, guys!

Is that your occupancy data is coming from an external data source like an Excel file?

No. It’s in a calculated field, so I can’t directly use it in a tag. I have to copy that info to a parameter for the room in order to tag it.

Thanks to Julie Kidder on RevitForum.org
Exactly what I needed. :slight_smile:

Her example:

Final script: