Splitting tree branches by index (Split tree multi?)

Hello all!

Long time, no speak.

Long story short, I have got a lot of data from octopus. This data has multiple generations, and in these generations there is multiple sets. This creates a tree of x branches, where x is the amount of generations. For instance, I have 199 generations, so the tree looks like this:

Within each of these sublists is a data for each member. These members are separated through 2x entries, as shown:

Now. I need to split these branches where the empties happen. So, I’ve tried split list multi etc, but this doesn’t work. Neither does split tree etc. I have even managed to get where I need the tree to split:

With the aim of getting the list to look as follows {Generation; Member}. i.e. If there was a list as follows:


----{0} G1M1a

----{1} G1M1b

----{2} <.empty>

----{3} <.empty>

----{4} G1M2a

----{5} G1M2a


----{0} G2M1a

----{1} G2M1b

----{2} <.empty>

----{3} <.empty>

----{4} G2M2a

----{5} G2M2a

it would turn into:



--------{0} G1M1a

--------{1} G1M1b


--------{0} G1M2a

--------{1} G1M2a



--------{0} G2M1a

--------{1} G2M1b


--------{0} G2M2a

--------{1} G2M2a

If possible, a general way of splitting trees in this method would really help me! I always get stuck on this.

Also, I’ve attached the file if that helps.

Usablelistcreator.gh (2.3 MB)


Usablelistcreator_ww.gh (2.3 MB)

not the most elegant perhaps
but gets the job done

Thanks for this Will! I will have a look later this week and report back. It seems to be a problem that plagues only me judging by a search on the forums and Google.

Hi Will! It looks great, however I can’t seem to find Ghpythonlib.treehelpers? Is this a custom module?

I cannot find Ghpythonlib at all on my system… Would you mind letting me know which folder it is in for you so I can try and trouble shoot (I’m running the latest Rhino 6 so should have it!)

Thank you so much for your help by the way.

C:\Users\YOU\AppData\Roaming\McNeel\Rhinoceros\6.0\Plug-ins\IronPython (LONG ID STRING)\settings\lib\

I found it there

1 Like

How odd! I don’t seem to have it - Any clue how I could fix this?


treehelpers.py (2.7 KB)

put this file in that folder

1 Like

Cheers my man!