Renumber rooms by level - Revit and Dynamo workflows explained

Our architect asked me recently, if it's possible to add the level prefix to room numbers in Revit. Assuming that the building is relatively large, this is certainly the task that requires automation. However, this could also be done in a semi-automatic way via the Revit room schedule... So let's take a look at both Revit and Dynamo workflows, and see the difference between them.

Revit semi-automatic renumbering

  • Create Room schedule with the following fields: Number, Name, Level, Shared parameter (RoomLevel in our case):
  • Switch to the "Sorting/Grouping" tab, then set the schedule sorting by "Level" and toggle off "Itemize every instance" :
  • Click "OK" to close the schedule properties window, then fill in your custom parameter values ("RoomLevel) according to the corresponding levels. If you then toggle on "Itemize every instance", you'll get the following result:

[gallery ids="618,620" type="rectangular"]

While this workflow doesn't take too much time to accomplish, it requires some tweaking: you need to add shared parameter to both Revit project and room tag family, which is not convenient. Otherwise you won't be able to tag the rooms properly.

Dynamo automatic renumbering

Now that we've seen what could be done in Revit out of the box, let's improve this workflow.  As you may know, Dynamo flawlessly interacts with element parameters, which means that it can read parameter values, change them, and write back to the same elements. Below you can see a simple Dynamo script that automates room numbering in Revit:


The logic behind this script is the following:

  • Take all rooms from the current Revit document, and filter them by selected level
  • Get the room number values from these filtered rooms, then cut off the first digit
  • Get the level names and split the strings to get the level number. Then feed this number into the room elements (Element.SetParameterByName).

This workflow allows us to fully automate the numbering process, as far as we don't need to add any shared parameter(s) and play with room shedule sorting/grouping. The process goes 'under the hood', resulting in modified builtin parameter values. And this sounds quite awesome, doesn't it?

Note that this Dynamo graph may not work for you, if you use different level naming conventions. In this case you may need to rethink your logic like this:


Or you can create your own list of level numbers in Dynamo (List.Create), or maybe feed them into Dynamo via Excel table. Still it's up to you to decide which of the workflows and logic(s) is suitable in your particular project.

Download Dynamo graphs here: Dynamo_RenumberRoomsByLevel (tested under Revit 2016+ and Dynamo 1.3.0).