Put culled / seperate curves back to data tree (to match branches)

Hello everyone,

My name is Mario and this is my first post here. To keep it short i’am writing a thesis about generative floor plan solutions and at this point I would need some help.

As you can see on the first screenshot there is an outer wall and a corridor / hallway. On the hallway the two points would create the separation walls between the units as curves. Next I would like to add points of the entrance door as well as points on the outer wall for further separation depending on the size of the current unit.


(I created the first screenshot manually to visualize my intend)

And here comes the problem – as you can see on the second screenshot the index of the lines are all over the place due to the surface split. The best would be if Index 0 would be the corridor wall of each unit (in green / circle as entrance point). Index 1 would be the outer walls either as line or a joined polyline (blue). Index 2 and 3 for the inner walls (light red).
So basically I would need the seperation of the different walls so the graph lines from the middle of the units would cover the whole outer wall / move around the corner as well

Im still relatively new to Grasshopper and still have to learn how I can use lists and trees more efficient. However in the attached file I could already separate the three different walls (outer, inner, hallway). So the main question is how I could put the lines and polylines back into the data tree to match the branches of the original curves?

To shorten it up the problem lies in the cull elements as they only seem to work with flat lists?
Or would you suggest a different approach with the same outcome?

I would be very thankful for any help :slight_smile:

rearrange_culled_curves_v2.gh (25.8 KB)