Renumber rooms

As architects, we commonly find ourselves faced with a large number of rooms on a floor plan that must be numbered sequentially based on their layout. This type of data is not easily manipulated within a tabular format of an Excel spreadsheet nor a Revit schedule. We need to see the spatial configuration of rooms in a plan to understand how the renumbering needs to be applied.

The Parametric Monkey Dynamo package solves this problem with the ‘Room.RenumberByModelCurve‘ custom node. Users are required to draw a (model) spline through the rooms to be numbered. Only rooms that intersect the curve will be processed. This method allows for batch processing which is often desirable. The number sequence precision can then be set. For example, a precision of 1 will result in 0, 1, 2, etc., whereas a precision of 2 will result in 00, 01, 02, etc. An optional prefix, such as the level number, can also be set. There is also the option to exclude certain room names which cannot avoid being intersected by the model curve, such as circulation.

To ensure accuracy, ensure the spline passes approximately through the centre of the room, and that those room elements are centred within their respective room boundaries. This modification is required because, behind the scenes, the script is collecting all rooms and extracting their location point. This point is then used as a reference to evaluate the closest point to the curve. These points, and the associated rooms, are then sorted based on their curve parameter. A sequence of numbers is then created and converted to a string to avoid any precision issues. This string is then concatenated with the desired prefix. The model curve can then be deleted or retained on a hidden workset, for example, for future modification.

76 Comments on “Renumber rooms

  1. Hi there,

    Q. How can I get the room numbering to start at Room 01 and not Room 00.

    If you input a Precision value of 3 into the Code Block the room numbers starts at 001 but if you input Precision of 2 the rooms number start at 00. Is this a error in the script?

    Thanking you in advance


    • Hi Rob. There is an input called ‘starting number’. It needs to correspond to the precision. For example, if you want 3 digits, enter 0.001 (or 0). If you want 2 digits, enter 0.01 (or 0).

      • Yes but the numbering starts with “.00” and not “.01” if you use a precision of 2 but if you use a precision of 3 you get .001 which is correct.

    • Dzung can you supply more info – what Revit version, Dynamo version and BVN package are you using? You need to use the latest version of BVN which is tested on Revit 2018 and Dynamo 1.3. Also check your geometry working range.

      • Hi Dzung. It works for me

        As I mentioned previously, you need to check you geometry working range. In Dynamo go Settings > Geometry Working Range > and set to Large. The script is looking for the rooms centre point and then the closest point on the curve to sort the rooms. Using millimeters causes issues with tolerance and rounding. This is why the Dynamo team introduced the Geometry Working Range. Generally if using mm, set it to large. It is annoying that no warning error pops up but I’m not sure I can fix that.

        Let me know if that fixes your problem.

        • Hi, Paul.
          Finally it works. Many thanks for your prompt response.
          Sorry that I skip the part ” working range” in your first reply. You can delete my unnecessary comment if need :). Thanks.

  2. estoy trabajando en este tipo de definiciones exactamente que es lo que tengo que seleccionar porque selecciono el room pero no me aparecen en watch todos los rooms y no se cambia.

  3. Hi there

    I can’t seem to get it to work

    Revit 2015
    Build: 20150303_1515(x64) update release 7

    Dynamo Core:
    BVN: 1.5.2

    Any help would be great

        • Hi Oliver. Are you working in millimetres? Geometry Working Range is only available for Dynamo 1.3 and higher. Check out this blog post for more info:

          Older versions of the custom node scaled down the geometry to perform the intersection as a work around. I removed this as Geometry Working Range essentially does the same thing. If you don’t want to update Dynamo, you’ll need to use an older version of the BVN package but I’m not sure which version I changed it in.

          • Awesome

            I’ll go try find the correct one then post here incase somebody else needs.

            Thank you!

            BTW nice work ! 🙂

  4. Paul,

    I am using Revit 2017 2.2 and Dynamo I downloaded the BVN Package this morning and I can not seem to the node to work. I dug into the node a bit and noticed that there is an error in the get phases section of the script. The after the Get.ParameterValueByName is null and seem to be causing the the null list of rooms. Can you check into this or perhaps let me know if I am missing something. I have recreated the script exactly as you have posted as well as checked the Geometry Working Range.

    • Hi Chris. The get phase nodes works on the current view – Are you running the script in a floor plan? It might fail if you try and run it in say a schedule or something like that. Also, have you refreshed the boolean toggle input – if this doesn’t run, Lunchbox won’t collect any rooms. If it still doesn’t work, can you send me the file and I’ll take a look –

      • I am running it from a plan which is the only view open in the file. I will email you for further assistance.

        • Hi Paul,
          Above issue has been solved? i m facing that issue exactly and can you please advise… ? Getparameter of phase which is the ” String” but elementiD want to have argument value.

  5. Hi, I’m having an issue with the numbering, for some reason I’m getting alot of 0’s, I have Number Prefix: 1.10, Code Block: 3, Number: 0.001, and it is renumbering my rooms at 1.100000001, I need it to start at 1.101, how can I accomplish this?

    • Hi Maria. Your prefix should be “1.” (code block with speech marks). Precision 3 (code block). starting number 0.101 (code block). That should work. Let me know if you still have problems.

  6. Hi Paul,

    I’m trying this out and I’m getting an error as per the attached. It’s like the input string is incorrect but I’ve exactly matched what you’ve posted above as an example. I’m on Revit 17 with Dynamo

    • Ah looks like I got it working by changing the code block of “2” to an Integer slider.
      Now the code runs fine, but it isn’t actually renaming my rooms. The output of elements is correct however. Hmmm

        • Thank you for your help Paul, and for sharing your work for us all to use.
          Here is an image of my Dynamo with the spline selected.

          You can see that it grabs the rooms well enough, and appears to exclude the corridor, but the actual ‘renaming’ doesn’t occur. The Spline was drawn from the centre, outward to test.

          Ta again.

          • Hi Thiefsie. Are you talking about renaming or renumbering? Your room tag looks like it is only showing the room name. This node is designed to renumbering the room number parameter. If you add in a prefix ‘APT-1’ that is a string (text) value. Room number needs to be a number so it won’t work. Also the starting number should be 0.01.

            • Oh wow. That’s really dumb of me!

              Thank you again for taking the time to help out a clutz like me!

              Big fan of BVN here being a Melbourne Architect. Cheers

  7. Working through this by reviewing some of the errors people have had in previous comments. I think I have everything setup correctly but it looks like the watch node attached to elements only says null and will not show rooms.

    • Chad you are going to have to give me more information. Which Revit/Dynamo version are you using? Which version of Parametric Monkey? Can you post a screenshot pls.

  8. Hi,
    I am also having trouble getting this to work. I have set the Geometry Working Range to large, I am using Revit 2018, and Dynamo 1.3. Can I email you the file and script?

    • Hi Julia. What package and version are you using? Can you upload a link to a screenshot please.

    • Hi Julia. Which package and version are you using? Can you upload a link to a screenshot pls.

  9. Goodmorning,

    I’m having the same problem of “null” list using the node.
    I set correctly the parameters and the geometry scale, the node can detect how many rooms are intersected by the curve but no way to get them renamed as I wish.

    at the following link you can find some screenshots to better explain the situation:

    Thanks in advance for you help!

      • Hi Paul, thank for your answer.

        I’m actually using RVT 2019.2 and Dynamo 2.0.2. I’ve tryied several setting for the geometry working range but still impossible for me to use the node.
        Here to you the link with thesample I’ve screenshoot you yesterday, which is designed in meters:

        Looking forward your magic trick Paul 🙂

        Thanks in advance

      • You also will need to update the ‘Room.GetAll’ node to as this has English parameters embedded into it.

    • Yes as I mentioned, you’ll need to update this too. It is looking for the parameters like ‘name’, ‘number’, etc. Just update these to the language you have installed so that it can find the correct parameter.

  10. It works!!! Brilliant intuition Paul, thanks.

    Actually the problem was in the group “To Revit” and I just had to change the string “number” to “numéro”.

    I’m posting a screenshot in case it can be useful to someone else:

    Thanks again and keep on with your great job!!


  11. This is great. How would you add UI inputs so that others in my office could use it?

    I have tried but nothing has worked.
    Tried using


      • I would like that. (Its actually my question)
        The graph above does not actually have any UI inputs.
        Any that I have tried to add don’t work. Maybe I’m doing something wrong.

        • OK. There are inputs in the graph – select model element, prefix, etc. To be compatible with Dynamo Player, the inputs can’t be code blocks. They need to be strings, numbers, etc. i.e. Don’t use “14” in a code block, use 14 in a string node.

          As long as you haven’t used any code blocks, you can right click on the nodes and make sure ‘is input’ is selected. This way, when it is open in Dynamo Player, the inputs will be exposed. You don’t need to make a custom UI (for example with Data Shapes). Also FYI, you can make watch nodes an output by right clicking on them and selecting ‘Is output’.

          I hope that helps.

  12. Hi Paul.

    Using Revit 2019.2.1 and dynamo I’ve got the following problem:

    It will only renumber the first room.

    Geometry working range is set to Large.
    I also centered the rooms before.

    • Can you post an image or file please. Also is your project in English or another language?

    • Jeroen if your file isn’t in English, please check previous comments about how to solve

      • Paul,

        The project is based on an English template, the built-in parameters (Level, Name and Number) are standard also.

        • Hi Jeroen

          I’ve found the problem. The custom node is checking the current view’s phase and then filtering out all rooms which don’t have the same phase. Otherwise rooms from another phase would be renumbered even though they weren’t visible.

          Somewhere between Dynamo 1.3 and Dynamo 2 they changed how an element’s phase is returned. It use to be an element, that is, an element with a name and an ID. Now it is just a name. To temporarily fix the issue, just go into the custom node and make the following changes. Assuming you don’t have any phases which are identically named (which you don’t), this should work…

    • Hi Sarah. What package is that node from? If it is from the BVN package, I am no longer maintaining this.

      • Thanks for quick reply Paul. Yes, that is a BVN package. I also don’t seem to find the “Select Spline Element” I am using “Select Model Element” node instead. Could that be the cause of problem? Also fixed the custom node per your comment on removing element ID nodes. Is there any chance if you could share the latest graph that you could get it to work. Thanks again!

        • Hi Sarah.

          I don’t share graphs any more because I get a lot of students just wanting to download stuff and not actually learn. I suggest you use the Parametric Monkey package to begin with. If you want to use the BVN package you’ll need to contact them as I don’t maintain it anymore.

          Select model element is correct. I had renamed the node so that it appears correctly in Dynamo Player. If you have fixed the element ID issue and your file is in English, the next likely culprit is the geometry working range. Have you checked this? If it still isn’t working, please upload the Revit and Dynamo file and I’ll take a look.

          • Great, I’ll check on those. Thanks again for quick responses

          • Paul, the Parametric Monkey node is working great. Is there any way to exclude a list of rooms from being renumbered instead of one room. Or could I change the parameter to something different “department” for example to bundle up the rooms that are being excluded but still keep the name the same. Thanks

            • OK great. that’s good to hear.

              The filtering out is via room name, for example “corridor”. I don’t believe it will work for a list of names. You’ve got a few options without needing to edit the node. Either ‘hide’ the rooms in question by temporarily placing them on a different phase. OR just draw multiple splines that don’t cross the rooms to be filtered out. Then run the script several times. You can set the start number which allows you to run batches. I hope that helps.

  13. Hi Paul,
    The script is working on my machine perfectly fine, but once run it on another machine, the same file, with all the packages installed it does not make any changes. Any suggestion what might cause that?

    • It was the IDs again which got fixed. all good! 🙂

  14. Hi Paul,
    Using Revit 2019 and Dynamo 2.03, I m not getting it to work. it gives the following message:
    Dereferencing a non-pointer.
    Internal error, please report: Dereferencing a non-pointer.
    Internal error, please report: Dereferencing a non-pointer.
    __func_164454d4335d47d9a1f170bb360dc9c4 expects argument type(s) (var[]..[], string, int, int, var[]..[], bool), but was called with (Autodesk.DesignScript.Geometry.NurbsCurve[], double, int, int, string, bool).

    I am using the parametric monkey package and the select element node + geometry curve. Rythym brought out a similar node yet I don’t get to work that either.

    Thanks in advance


    • Hi Phillip.

      There are at least two issues. You should be feeding in an element (model line) so no need to element.curves. The other is that the prefix need to be a string (text). You have a number.

      See if that works. If not, run it using a ‘Medium’ geometry working range in settings. It worked for me.

      Let me know if you still have problems.

  15. Hi Paul,

    I think i have the script working in order, but I am having some problems with certain rooms in my plan. The script seems to skip a few…? I wonder if this is related to the script or to my model? The same thing occurs at the same place at different levels.

    The script and print screen of my model are attached in the download link:

    Hope you can help. This is my first time using Dynamo.

    Thanks in advance

    • Hi Jasper.

      The likely reason is that those rooms are from a different phase. The script filters out all rooms that don’t match the active view’s phase. Otherwise, rooms that aren’t visible would also be included in the renumbering process. Sorry for the confusion – I thought I had mentioned it in the tutorial. Let me know if that fixes your problem.

      • Hi Paul,

        unfortunately it did not solve my problem. I did find some rooms that were not placed, but after deleting them in my schedule the same problem occured. Even when I cut and paste my rooms in the active view the same three rooms are passed by the script. Even when I make all new rooms the same rooms in the same place are passed.

        The script is working fine in another building in the same model at another phase however. So i guess the fault lies in my model. I just can’t figure out where…

        Thanks for your time and advise!

        • OK so if it isn’t phase related, it might be geometry related. Can you check the room heights and make sure the rooms below aren’t accidentally protruding into the rooms above. Also check the room to make sure there are no self intersecting boundaries. Rooms will be skipped if a valid intersection with the spline can’t be found.

  16. Hi Paul,

    I have a noob question, but where can I find your dynamo player Room Check node? I have checked the room Heights and there is nothing wrong there, so it must be the intersecting boundaries. This I wanted to check using your Room Check node, but I am not able to load this in the dynamo player. Do I have to install a additional package? Sorry for the multitude of questions! I understand if I’m consuming to much of your time.

    • I haven’t published that node. But if you just select the rooms and isolate them you can do a quick visual check to see if there are problems. If this isn’t the issue then I would need to take a look at the Revit model to understand why it’s failing.

  17. Visually there is nothing wrong with the room boundaries. It would be much appreciated if you would take a look at the model. Here’s the link.

    The problem occurs at the floorplan; 00_BGG_VSL R and the floorplans above.

    I am dedicated in solving this issue although it is taking way more time than working around it (which i have already done…)

    • Hi Jasper.

      So the script is working OK. The problematic rooms are being excluded (and returned) as intended. The problem is due to the alignment of the model groups. They are approximately 0.4mm off from the party walls. When I looked at Room 0.37 for example, the door area is causing the issue.

      Because of the very small gap, the room boundary can’t be calculated (returns null) which means that an intersection can’t be found and therefore it is excluded. It’s possible to design this out of the script but it would just cause other problems elsewhere. This is why I developed the room checker script – to identify problems before running these sort of operations. If you want a quick and dirty way to solve it, you can go into the Room.GetAll node and set the tolerance to 0.04 for the polycurve.byjoinedcurve node. This will automatically close the gap for you in Dynamo (but won’t fix the Revit model) and the script will be able to find the intersection.

      I hope that helps.

  18. Hi Paul,

    Thanks for analyzing my model. I found the problems and fixed them in my model. It works perfectly now 🙂

    I am awed with the complexity of your custom nodes! After looking into them I found the joinTolerance and changing this using a string works also.

    Thanks for making me a better modeler!

Leave a Reply

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