Renumbering rooms based on multiple parameters

I am a complete newbie to Dynamo. I have managed make a few simple scripts and thats it.
So I really don’t know where to start with this. I have tried searching for similar issues, but havn’t been able to find something useful.

I want to use Dynamo to renumber all rooms based on multiple parameters.

We can have several buildings in the same model so I need to renumber all my rooms based on level and a shared parameter(buildingID).

Example
Level 1, Building 1, Room number: 001, 002, 003 etc.
Level 1, Building 2, Room number: 001, 002, 003 etc.
Level 2, Building 1, Room number: 001, 002, 003 etc.

Is this at all possible?

As long as your room numbers are unique it should be doable.

Oh, why do they need to be unique?

just try it, revit will give you a warning

Hey,

So yes very doable… Usually this is based off drawing a Spline to define the order of rooms, with various filters to remove rooms with no area or perhaps to not number corridors.

For a rectangular building you can find the average location point and number according to angle, pulling level information or whatever you want to plug in.

I think the problem you’ll have is the examples will be from long long ago…

I would go through this Archilab blog (though you’ll likely find nodes have changed name in the years since) as a great learning experience from a master.

Here’s some other stuff you might find useful…

Cheers,

Mark

Hey Mark

Thanks a lot, I will give it a read see if it helps. Yeah I’ve run into guides and blogs that just don’t work anymore.
My main issue is figuring out how to get Dynamo to count from 1 whenever Level and the shared parameter changes so I can add the count number to the room number parameter. Which might not have been clear based on my OP.

Ok cool, have a look at my graph, i group by key using level then count the numbers in each group… then you can just put 1…X and flatten the result…

1 Like

Hey Mark

Group and flatten works like a charm! Thanks.

I tried to recreate your graph, just to get a sense of how it works. But as you can see the end results doesnt show the correct roomnumber. What did I do wrong?

No worries…Hmm… difficult to see, I’d guess it’s your ‘get item at index’? maybe needs to be a level down? The next code block’s only got 20 things in it?

I’m sitting with a test project that only contains 20 rooms total.

It seems that it is the Element input on setparameter node. However, if I change to input to come from All elements, the numbers looks right, but get placed wrong, level1 rooms on level 2 etc.

Oh sorry, yes, I think the problem is that you need to flatten the output from the group by key node…

If you can’t see where the problem is, it’s best to expand everything out and track it back…

1 Like

Thanks! That did the trick!
Now I just need to figure out how to GroupByKey twice

Finally got it to work!! All I had to do was choose level on the second GroupByKey!

good job!
but i would still recommend using unique numbers for your Rooms.
If later in the design proces you would want to make an inventory list of all the items that are placed inside the Rooms, the Room number 001 would give you no clue where the item is, having many.
If you use the search button and see how many workflows make use of the Room number parameter for doing Room finished for example i would think twice.

The models I work with is designed for FM, so unique room numbers are not necessary. In fact they end up cluttering the screen for the people working with leases and contracts. I tried to get it implemented but they prefer the 3-digit number, and they have other means of filtering the rooms by the FM system.

Appreciate the advise though and agree with you, it’s just not up to me.

1 Like