Room numbers to Door

Hello,
I’ve used a node from Rythm to sort out doors and rooms that have a connection. I now want to add a number behind this information so that you can see how many doors that belongs to a certain room. I’m stuck on how to solve the last bit, how to append the running number. I guess I could write to excel and then read from excel but I’m looking to automate the whole process if possible?

Thank you,
Rickard

DoorTagByRoom.dyn (12.3 KB)

One nudge in the right direction: Try a List.GroupByKey instead of a sort by key. Then a List.Count, number range, and join.

List lacing and list levels will matter here. :slight_smile:

Thank you Jacob!
I really had to think and spend som time with this one :). This is my solution. I guess you could have done this without the python node I just couldn’t figure out how. Anyhow, this solution worked. Thank you again for your input Jakob.

Python node below:

**# Load the Python Standard and DesignScript Libraries**
**import sys**
**import clr**
**clr.AddReference('ProtoGeometry')**
**from Autodesk.DesignScript.Geometry import ***

**# The inputs to this node will be stored as a list in the IN variables.**
**dataEnteringNode = IN**

**# Place your code below this line**
**lst_rooms=IN[0]**
**lst_doors=IN[1]**

**list_names=[]**

**for i in range(len(lst_rooms)):**
**	list_names.append(str(lst_rooms[i])+"."+str(lst_doors[i]))**

**# Assign your output to the OUT variable.**
**OUT = list_names**

1 Like

1 Like

Thank you Bjorn!
I tested it and the output is excatly the same, very nice! I learned something new there.