Renumber doors based on their "to room" parameter - List Logic

Hi,

Reenctly returned to dynamo after far too long away.

attempting to renumber doors based on their “to room” parameter.

I have the logic of numbering the door sorted, but the list.groupbykey node seems to be scambling my lists, or outputting a string rather than an element.

feel very close to the solution but oh so far…

Try wiring the doors from your code block (2nd node) into the list input. The unique keys likely want to go into the + node to create the DR.*** prefix.

Hi Jacob, this works but the list order is scrambled by the groupbykey node

That’s ok, as the keys are also scrambled in the same way and you are setting the scrambled elements by the scrambled keys. You could first sort the lists and keys using a List.SortByKey node where the lists were the lists, and the keys are the unique keys output, but unless there is more automation in this which ought to not be moved into a new graph then you might as well stop here.

Thanks Jacob. the below from @Mostafa_El_Ayoubi seems to arrange the graph in a much better way than me & it seems to work

image

Hello.

“0…List.Count(a<1>)-1;” allows the doors in a room to be numbered according to the room. But how can we number the room doors for the whole building?

Flatten the list with a List.Flatten node, then count that.

Thanks @jacob.small