Partition branch from dynamic lists

Heya folks,

I’m trying to do something that’s probably very simple, I just got stuck and can’t figure it out.

I got a main list with data and want to partition it using another list as template. Both lists are dynamic and the number of branches and indices within the branches can change. How would you solve this? Let me know if the question wasn’t clear enough.

Partition branch.gh (325.4 KB)

If you create two Ranges of integers (I think using the Series component) from your second Data, i.e. [0,1,2,3] and [4,5,6,7,8], then feed those into two Tree Branch components as paths, with your first Data as Tree input, you have splitted the branches. (Sorry, I’m not at my PC so I can’t make a screenshot for illustration)

Hi Menno,

Thanks for your quick response. But if I understand your solution correctly, for every partition an additional Tree Branch is needed (see screen dump below). I have an unknown amount of branches and I need a solution that can take that into account.

I see this every day on this forum and think it’s ridiculous and rather insulting for anyone to assume that something they can’t figure out for themselves is “probably very simple”. There is rarely only one way to solve any problem.


Partition branch_2020May02a.gh (334.1 KB)

1 Like

Many thanks Joseph!

Well that’s my experience as I’m quite new to GH. In this case it wasn’t as simple as I thought, I assumed there was a component that did this already but I just couldn’t find it.

And I’ll assume that there was a better way to organize your upstream data trees to avoid this requirement in the first place.

You are obviously free to assume whatever you like. Have a splendid day.