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.
Computational logic
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. All room elements should be 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
Rob
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
Rob
paulwintour
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).
Rob
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.
paulwintour
Rob. Please re-read my comment. You need to change the ‘starting number’ input…
https://www.dropbox.com/s/pjew6m9rq3o465a/Dynamo_RenumberRooms1.png?dl=0
https://www.dropbox.com/s/r06iziwmet9n8gh/Dynamo_RenumberRooms2.png?dl=0
Rob
Thanks Paul,
That worked for me now 🙂
Dzung Pham
Hi there, I have try this script but it doesn’t change anything. Can you have look at my file in this link:
https://drive.google.com/drive/folders/0B-0S19g0NlPSYS1MeXlvWTgzem8?usp=sharing
Many thanks.
paulwintour
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.
Dzung Pham
Thanks for your reply. I am using Revit 2017 and Dynamo 1.3. Here are the packages that I already installed.
https://drive.google.com/open?id=0B-0S19g0NlPSU2wwcDFKRy1TZzQ
Thanks.
Dzung Pham
Sorry that I post the wrong link, here it is:
https://drive.google.com/file/d/0B-0S19g0NlPSMmh6aGVyX193RGM/view?usp=sharing
paulwintour
Hi Dzung. It works for me
https://www.dropbox.com/s/oqj3ceizrbyvsrc/Dynamo_RenumberRooms3.png?dl=0
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.
Dzung Pham
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.
gloria aguilar
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.
Oliver
Hi there
I can’t seem to get it to work
Revit 2015
Build: 20150303_1515(x64) update release 7
Dynamo Core: 1.2.1.3083
BVN: 1.5.2
Any help would be great
paulwintour
Hi Oliver. Have you set your Geometry Working Range (refer previous comments)?
Oliver
Hi Paul
I went looking for it I settings and don’t seem to have that option available
here is my options available:
https://ibb.co/bQfsWG
paulwintour
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: http://dynamobim.org/think-big-geometry-with-lots-of-zeros/
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.
Oliver
Awesome
I’ll go try find the correct one then post here incase somebody else needs.
Thank you!
BTW nice work ! 🙂
Chris Grammens
Paul,
I am using Revit 2017 2.2 and Dynamo 1.3.2.2480. 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 element.id 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.
paulwintour
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 – paulw@parametricmonkey.com
Chris Grammens
I am running it from a plan which is the only view open in the file. I will email you for further assistance.
Wanna
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.
Thanks
Wanna
Problem solved.
Thanks
Maria
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?
paulwintour
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.
Thiefsie
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 1.3.2.2480.
https://imgur.com/a/Ou7LF
Thiefsie
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
paulwintour
Can you post a screen shot pls
Thiefsie
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.
https://imgur.com/a/jO1jp
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.
paulwintour
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.
Thiefsie
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
Chad Wulleman
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.
paulwintour
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.
Julia
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?
paulwintour
Hi Julia. What package and version are you using? Can you upload a link to a screenshot please.
paulwintour
Hi Julia. Which package and version are you using? Can you upload a link to a screenshot pls.
Luca Caiazzo
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: https://we.tl/t-OZlGjZb6Z7
Thanks in advance for you help!
paulwintour
Hi Luca. It is working for me in Dynamo 2.2: https://www.dropbox.com/s/iuioswsbtl139qf/Room%20renumber.JPG?dl=0
Can you upload your file pls. Assuming you have installed everything correctly, the cause of most issues is the geometry working range. Have you set this correctly? Are you working in cm?
Luca Caiazzo
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:
https://we.tl/t-iRDHObWPjC
Looking forward your magic trick Paul 🙂
Thanks in advance
paulwintour
Hi Luca
Your file is working fine for me: https://www.dropbox.com/s/h20cwryqsy50dbf/Room%20renumber2.JPG?dl=0
Assuming you have set the correct geometry working range (note: this is now called ‘Geometry scaling’ in Dynamo 2), I suspect the issue is with French. Are all your parameters in French? The node is filtering out rooms based on ‘Phase’. If ‘Phase’ is actually something else, it will filter all the rooms and won’t renumber any. If this is the case, just go into the node and update by changing the parameter name: https://www.dropbox.com/s/7v2qkffyge6whel/Room%20renumber3.JPG?dl=0
It’s a bit hard for me to test without the specific language installed. Let me know if that solves the issue.
paulwintour
You also will need to update the ‘Room.GetAll’ node to as this has English parameters embedded into it.
Luca Caiazzo
I did it but also on this node it seems I’m having problems: half of the parameters are not read
https://we.tl/t-myM2Ub7Vqf
paulwintour
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.
Luca Caiazzo
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: https://we.tl/t-ASkHzfLGg8
Thanks again and keep on with your great job!!
Luca
paulwintour
Glad it worked
Jeff Nelson
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
UI.SelectModelElements.Data
UI.Textbox.Data
UI.Slider
Thanks
paulwintour
Why can’t they just use Dynamo Player?
Jeff Nelson
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.
paulwintour
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.
Jeff Nelson
I got it. I had several nodes missing. Hadn’t thought it through. Here is the graph for anyone that cares.
https://www.dropbox.com/s/ygfghzeo43ye0hy/Room%20Renumber%20By%20Spline.dyn?dl=0
Jeroen Reynders
Hi Paul.
Using Revit 2019.2.1 and dynamo 2.0.2.6833 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.
paulwintour
Can you post an image or file please. Also is your project in English or another language?
Jeroen Reynders
Hi Paul,
Here you go:
https://we.tl/t-rNECI0Twhb
It is just a test file with walls and rooms
My humble guess is that the spline isn’t properly divided.
Thanks.
paulwintour
Jeroen if your file isn’t in English, please check previous comments about how to solve
Jeroen Reynders
Paul,
The project is based on an English template, the built-in parameters (Level, Name and Number) are standard also.
paulwintour
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…
https://www.dropbox.com/s/849c7az7sv4k388/RenumberRooms.JPG?dl=0
sarahfallahi@gmail.com
Hi Paul,
Trying this with Dynamo 2.0.2 and still getting empty list from RenumberByModelCurve node. I’d appreciate if you could take a look into this. Thanks
Here is the link to the graph: https://www.dropbox.com/s/akw6lyvvewvzk1z/Renumbering%20Rooms%20by%20Spline.JPG?dl=0
paulwintour
Hi Sarah. What package is that node from? If it is from the BVN package, I am no longer maintaining this.
sarahfallahi@gmail.com
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!
paulwintour
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.
sarahfallahi@gmail.com
Great, I’ll check on those. Thanks again for quick responses
sarahfallahi@gmail.com
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
paulwintour
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.
sarahfallahi@gmail.com
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?
Thanks
sarahfallahi@gmail.com
It was the IDs again which got fixed. all good! 🙂
Philipp
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.
https://we.tl/t-MC851mg8Qc
Thanks in advance
Philipp
paulwintour
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.
Jasper
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:
https://we.tl/t-3XQGZwalei
Hope you can help. This is my first time using Dynamo.
Thanks in advance
paulwintour
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.
Jasper
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!
paulwintour
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.
Jasper
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.
paulwintour
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.
Jasper
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.
https://we.tl/t-SMqlXrB78j
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…)
paulwintour
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.
Jasper
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!
paulwintour
Glad it worked and thanks for the feedback.