Split and Group Surfaces by Name and Sub Group

Hi community,

I have been trying to split areas using other areas as cutters and then group them. For a clear idea see bellow:

I have a group of tributary areas ( tributary area one in purple and tributary area 2 in red) that need to be further split into small areas based on the different usages (residential, balcony, corridor)

The final product needs to look like the image below:

So far I was able to split them and group them in the same branch:

image

I am stuck trying to figure out a way to assign to each new area the correct usage.

Does anyone have any suggestions or ideas to point me in the right direction? See attached grasshopper definition.

Split and Group Areas by Name and Sub group by Type.gh (33.4 KB)

Thanks in advance