Renumber doors by rooms

Revit has many fantastic automation features. For example, it can number elements sequentially, such as grids, rooms and doors, as they are placed in the model. However, since the architectural design is not a linear process, this sequence can quickly become out of date. Unfortunately, Revit doesn’t have an automatic renumber command to correct the problem. In the past, Architects have either had to do this manually or rely on 3rd party apps, such as Imaginit. These methods proved to be either time consuming and/or expensive. 

One particular task which consumes much more time than it should is the renumbering of doors based on the room in which it is located. Depending on your office’s naming conventions, a door generally is named something along the lines of, Element prefix – Room # – Sequence #, for example, D-101-01. Added complexity also comes into play when trying to define which room the door is located. Generally, a door will be numbered based on the ‘to’ room, unless that room is a corridor or an external area, in which case it reverts to the ‘from’ room. Confusing!


Since Revit 2014, when Autodesk introduced the room calculation point, it has been possible to schedule the ‘to’ and ‘from’ parameters in door families. This feature has its limitations and quirks as documented here. However, assuming the family has been built correctly, how can we automate the naming convention?

One possible answer is to use BIMlink to export the schedule into Excel. Using a series of conditional statements, we could semi-automate the process. But for this to work, you need to be a bit of an Excel wizard, and it’s not that user friendly. Conversely, we can create a simple Dynamo script which fully automates the process, is easy to use and eliminates the need for either Excel or BIMlink.

To do this, you can use the ‘Door.RenumberByRoom’ node found in the Parametric Monkey Dynamo package. Users have the option to enter a prefix, such as ‘D’, and a separator, such as ‘-‘. Depending on your offices’ naming conventions, the custom node can be edited and re-ordered as required. The script reads all doors in the project and returns the ‘to/from’ room number per door. By default, doors are renumbered based on the ‘to’ room. If however there is no ‘to’ room, such as an external door, it will revert to the ‘from’ room. If there is neither a ‘to’ or ‘from’ room, that is, there is a missing room, the doors will be excluded from the renumbering process. Once this is known, all doors within the same room are sequentially numbered in an anti-clockwise direction. Boom! Hundreds or thousands of doors renumbered instantaneously. 

If you require more flexibility in the naming convention, use the ‘Door.RenumberProperties‘ custom node. This node will allow you to concatenate the parameter as desired.

62 Comments on “Renumber doors by rooms

  1. Great script. Is it possible to complete without a prefix?

    • Hi Evan. In the previous version this wasn’t possible without going into the node and modifying it. However I have just uploaded v0.2.5 to fix this issue. If you don’t want the prefix, simply connect up a blank string node and it should work as expected.

  2. I don’t know what I am doing wrong i have loaded all the packages that i need, Created the above code, Run the script and i keep getting Null as a return value under watch. I have no doubt this is 100% my fault some how just cant figure it out but congratulations on the script this is a great time saver.

    • Hi Brendan

      If you install the BVN Dynamo package it will also install all the dependent packages so that shouldn’t be the problem. Without seeing a screenshot, here are the only things I can think of:
      – Ensure all the geometry is created in Revit, save the file, THEN open up Dynamo;
      – Ensure you are using a string node and not a code block (or if so use “quotation” marks);
      – Ensure you have run the script (or it is set to automatic).

      it is working for me so let me know how you get on.

      • Thanks Paul,
        I have reinstalled the packages through Dynamo this time, I got our IT department to disable our sever proxy to do this. Before i downloaded the packages and installed them on my local drive manually Dynamo didn’t seem to like that.

        I all so followed you above instructions, however it still doesn’t seem to work i’m thinking it might be an IT issue on our end I will give it a go at home

        I have also posted a screen grab below of the code

  3. Found the problem its Revit 2016 mid service update Dynamo doesn’t like it, The scripted worked fine in Revit 2015

    • Hi Brendon. Sorry for the late reply. I’m just switching over to Revit 2016 now. Let me test it and I’ll get back to you. There shouldn’t be any reason why it isn’t working.

  4. Hi, thanks for this script; just what we were looking for. I’ve made one adjustment to the custom node though: we use the marks from the From Room, so I’ve switched the connections in the custom node.
    Everyhing works fine, I did notice however that when I change a room number, the doornumber doesn’t update after I hit Run. When I close and re-open Dynamo en re-run the script it does work.
    Something we’re going to have to keep an eye on.

    • Hi Kimberly. I’m glad you found the node useful. Yes I am aware of that problem but I believe it is a limitation of Dynamo. But just to be sure, I’ve asked the Dynamo community. You can follow it here. I’ll let you know what I discover.

    • Hi Kimberly. I’ve updated a new vesion of the package. I’ve added a toggle to the node. It still won’t update automatically if you change the room number, but if you change the toggle (from true to false or vice versa) it will recompute and update. It just saves you closing and reopening the file. Not ideal but it is a limitation of Dynamo and how it executes Python nodes. Its a known issue:

  5. Hi Paul,

    I am having similar issues to Brendan, where the result is Null when I run the script. I am also using Revit 2016 and was just wondering if this is an issue or something else. I have tested the older version when this script was first created (v0.1.8) – this worked fine the first time and then Null after that. Not sure what would be the issue here.

  6. Hi. What version of Dynamo are you using? I think they might have changed the syntax for the input to clusters in version 0.9.2. Let me find out more and I’ll get back to you

  7. I have the same problem with Revit 2015 and Dynamo 1.0.

  8. Shady Dynamo 1.0 isn’t yet supported. There have been some major changes to how Dynamo works so it will take some time to update the package. All of the packages are having similar issues. I plan to release something in the next couple of weeks and will kepp you posted.

  9. hmm still not working here..
    Revit 2106 and Dynamo

    any help?

  10. This node has now been updated (v0.4.7) and has been tested on Revit 2016 R2 with Dynamo The problem was with the input/output syntax which changed. There was also a node from the Clockwork package which changed name. It should now work as expected. Please let me know if you experience any more issues.

  11. Is it possible to modify this to access rooms in files that are linked in?

      • yeah, the doors and walls are in the main file with rooms and other walls in another file that is linked in, can’t seem to get it to work without binding the link in.

  12. Hi Brad. Yes in theory it should be possible. However, I’m using lunchbox to collect all the rooms which only returns rooms in the current file. The node would need to be modified by replacing the Lunchbox component with either the Spring Nodes or Steam Nodes component to get the rooms in the linked file. But I’m having issues with these: I’ll let you know what I find out.

  13. Hi
    I am a complete beginner to Dynamo. I am having trouble getting this tool to work on Revit 2016. I did have it working in 2015.
    I have downloaded the packages but still no luck.
    I note that a ‘toggle’ command has been added to the Door Renumber node. How does this work?
    Many thanks for your help and for the great tool!

    • Hi Will. What version of the BVN package are you using? Is it the latest? It is a bit hard to troubleshoot without any images or files. Can you submit a post on the dynamobim forum and post the link here. That wway I’ll be able to take a closer look.

      The node use some python scripts inside it, namely Lunchbox room collector. If you make any modifications in Revit and re-run the Dynamo script, these Python nodes won’t re-run as it thinks nothing has changed. The boolean toggle is a work around to trick it to re-execuating so that you get the desired results. This is a known limitation of Dynamo and you’ll see this workaround in lots of other packages. If you set your script to automatic, just use the toggle and it should work.

      • Thanks for the help. I’ll try it again and post further details if still issues.

        Thank you again.

  14. hi, Paul,
    Thanks your great works. Here is my script that modified from your great work. It is because we use alphabet sequence instead of number sequence.

    Note: All lacings are Longest.

    • Then List.AlphabeticalSequence come from Clockwork Package

      • Hi Muses and Paul,

        We also do alphabetical sequencing, but when I am trying to copy the image above I am not able to replicate it as the List.Map does not exist in the version I am using. I am using the package from 1.3.2 from the 8th of May.

        Can someone please send an updated screenshot that I can replicate?


        • Hi Scott. What version of Dynamo are you using? The node has only been tested on Dynamo 1.3.3. If you are using Dynamo 2 then things are fundamentally different and possibly breaks the node.

  15. This node works great but when there are curtain wall doors in the model the result goes back to null and does not work. I’m pretty new to Dynamo, would I have to edit the node to filter out curtain panel doors? What would be the easiest way to do this?

    • Hi Chas. Sorry for the late reply. Curtain wall doors should work. They are working for me. Can you provide more info so that I can help.

      • Hi Paul. Sorry my bad. The reason it didn’t work was because there was no room created yet where the curtain door was. That’s why I had the null results.

  16. Is this node ok with revit 2017.2 on dynamo 1.2? i just seem to get null values back with it doing nothing to door numbers in revit. Be really cool to see this work.

    • Hi Van. I have only tested it with Revit 2017.1 and Dynamo 1.2 but I see no reason why it shouldn’t work on 2017.2. Can you tell me more about the problems – do you have standard doors with rooms in the model?

  17. I’m having the same issues as Van. Returns null values. Also running revit 2017.2 on dynamo 1.2.
    Worked fine in Revit 2016 on dynamo 1.2.
    Thanks for the help! Huge time saver on large projects!

  18. Hi Paul,
    I have tried to use your node, but all I get is “function” appearing in the watch node.
    I can’t work out what is wrong with it. Also, what do I do with toggle? Do I leave it blank? maybe good to say I am freshly new to Dynamo.
    I’m using revit 2017.2 on dynamo 1.2.

    • Hi. There is an issue with Revit 2017.2 apparently. I’m in the process of fixing/updating it. I’ll upload the latest version next week. Sorry for the delay.

  19. Hi everyone. This node has now been updated (v1.2.5). I have tested it with Revit 2018 and Dynamo 1.3. The node now no longer requires a prefix input. You can simply leave it empty if required. (Previously it required an empty string). Also the reason people were getting ‘function’ is that you had rooms missing and therefore it couldn’t find either the ‘to’ or ‘from’ room for the door. To fix this, the doors are now being excluded form the renumbering process if no room can be found. If you want to renumber the excluded doors simply click on the element in the watch node to find out where it exists, add in the room as appropriate and re-run.

  20. Hi Paul,
    This is a huge time saver. The only thing is we prefix our doors by letter instead of number, i.e: D.G01.A is it possible to change the prefix option?

  21. Hi Everyone. Please note I have updated this node in the latest version of the BVN package (v1.4.4). Its been tested on Revit 2018 and Dynamo 1.3.1. This updates fixes some bugs and includes some improvements. It will now work with curtain wall doors and rooms with multiple perimeters (such as an internal column which is room bounding). It will also renumber doors in design options. Again if you come across any issues, please post here and I’ll try to fix asap. Happy renumbering!

  22. Hi Paul,
    I have just started using Dynamo.This seems great and it’d be really useful, but i’m facing an issue. Hope you can help me with this –
    The “Watch” from renumberedElements shows null but the “Watch” from the excludedElements has about 160 doors. Could you tell me what has gone wrong? I think if it swaps, it should work in my case. But I don’t know what needs to be changed!
    ( I’m using Revit2017, Dynamo 1.3.1 and BVN 1.4.2)

    Thanks in advance!

    • Hi Meghna. The node will exclude doors if there is neither a ‘to’ or ‘from’ room, that is, if there is no room. Do you definitely have rooms in the model? It won’t work if the rooms are in a linked model for example.

  23. Hi Paul,

    I am also facing a similar issue as above as all doors are coming as excluded.

    It was working fine before, I only changed it to have the alphabet sequence and all doors were inside the excluded category.

    Any advice would be very helpful.



    • Hi Ramyo. What version of Revit, Dynamo and BVN package are you using? Please use latest version of the BVN package or at least v1.4.4 as there were some bug fixes. Also, please check that the door families have the room calculation point enabled. Rooms will be excluded if there is neither a ‘to’ or ‘from’ room. Let me know if this solves your problem.

      • Hi Paul,

        Got it working, issue was the older version.

        Thanks a lot.


  24. I cannot download the package without having to uninstall packages that all of my scripts are based off of.
    I get an error that says: “BVN 1.5.5 has dependencies. To install BVN 1.5.5, dynamo need to first uninstall the following dependent packages: LunchBox for Dynamo, Clockwork for Dynamo 1.x, Restart Dynamo to complete the uninstall, the try and download BVN 1.5.5 again.”

    I want to be able to use your node package, but if it is at the cost of losing 3 the most frequently used packages…unfortunately BVN is not usable for me.

    • Hi. Yes this is a problem with how the Package Manager works. What you need to do if installing via the package manager is to search for BVN and install. It will say that some packages need to be uninstalled first. They will be marked for removal. You need to close Dynamo and Revit to fully uninstall them. Then you must reopen Revit and Dynamo and try to install BVN again. This will automatically install the dependency packages including Archi-lab, Lunchbox and Clockwork. Thats what dependancies means. You won’t lose 3 of the most frequently used packages…

  25. Hi Paul,

    The naming convention in our office is a bit different from what you’ve created. I’ve modified it to have an alphabetical suffix based on your previous comment, but in addition to that rooms that only have one door should have no suffix. For example a 3 door room should still be 103A, 103B, 103C, but a single door room should simply be 104, not 104A. I’m new to Dynamo and I’ve tried to filter out all the rooms with only one door but it doesn’t seem to be working successfully. I’ve attached a screenshot of what I’ve tried so far:
    Could you suggest a solution?

    Thanks a lot.

  26. Hi Paul,

    I’ve been trying to modify this script to fit the naming convention at our office. I’ve already changed the suffix to be alphabetical based on your previous comment. The next issue is that for rooms with only one door we want no suffix. For example a room with three doors would still be 103A, 103B, 103C but a room with one door would be just 104. I’ve attached what I’ve tried so far: however, it hasn’t been successful.

    I’m new to Dynamo and any suggestions would be greatly appreciated.

  27. Hi Paul,

    I wasn’t able to figure out how to connect the example you provided above to the rest of the script in a way that gave the desired outcome. In the meanwhile I’ve modified your custom node to not place a suffix for multiple doors in one room. The majority of our rooms have one door so the manual entry of a letter suffix in those cases is minor. Though I would like to figure this out properly! Thanks,

  28. Hi Paul,

    I’m trying to modify the script so it numbers the doors A,B,C instead of the 1,2,3 but it’s not working. I’m new to dynamo and we have about a 500+ doors to rename by room number and tag ” 1001-A” etc.

    Here’s the link to my version of the script:

    This is what it shows up as:

    Also the suffix “.” is not changing to a “-” that we need to match the door naming convention in my office. Please help to solve this. Thank you.

    • Hi Faisal. Can you send me your file please so that I can take a look.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.