Room number

Hello I got a new “problem”.

I got a very big building. Buildings in a building.

This is what(I’m dreaming of) I want in my room number?

1: Building number (1-6)

2: Level (0-4)

3: Room number (01-99) The room number must have zero at the first. 01, 02, 03… 09, 10, 11…

4:I want to give the roomnumber according to the room bounding (x or z point)

Example room number: 6.409(6=Building, 4=Level, 09=roomnumber)

Is this possible? Or maybe I’m getting my hopes to high…

Maybe someone knows what function I should use?

I understand if this is a to big timekiller.

Bardur,

Yes, this should be possible. Keep going!

I’d try to get one list of rooms, grouped by Building and Level, and then sorted by XY position.

Then generate a sequence of numbers 0 to nn for each inner sublist (to give you the RoomNumber). I’d use a Double-Map technique as shown, but that’s increasingly unfashionable.

Finally format and concatenate the strings for each room, and SetParameter.

Kind regards,

David

 

 

1 Like

Bardur,

I was intrigued by the two-level Group (by Building and then Level), so I had a go. Seems to work OK.

I’d sort the rooms by XY before grouping. Grouping shouldn’t re-order the elements within each inner sublist. And it’s easier to sort the flat list.

Kind regards,

David

1 Like

Thank you david.

I did’t work perfect for me.

But I’m getting pretty close, I think.

The last codeblock is only getting 4 items og I have 6 item in this example.

Sorting by XY are gona be weekend work for me:)

Hi Bardur

Yes, you are only getting four items because of the way your code block is Lacing.

You need the code block to be able to match up the entries in your lists, to produce a list of strings that will match your list of Rooms.

One brute force approach would be to requery the parameters (level and building) with your grouped list of rooms. That would ensure that the level and building lists mapped exactly to the rooms list (and so the strings list would too).

You may be able to devise a more elegant approach using replication guides.

Kind regards

David

 

Here is a complete solution.

Lots of scope for further refining and improvement though.

File: RoomNumbering.dyn

Revit: RoomNumbering.rvt

20160515-4

Hi Vikram.

This is realy good stuff, very usefull and very helpfull to understand somethings in dynamo.

Our buildings have number in a parameter, so that part was not so advance as your solution.

In my dynamo program i got all part except to renumbering by x coordinat. And that is important.

Thank you very much for all your help.

It works perfect.

Hi Vikram.
I love this “number” program. I have used it very often.
But often there are room that will get the same X.point.

Something like this:
if(x=x, y.point, x.point)
Hope you understand my question?

Bárður

How can I sort them accordin to y.point.