How do I reverse specific sub-lists in a list?


Hi everyone,
I want to reverse every alternate sublist of a list that contains numerous sublists ?
The entire list can be reversed , but I want to reverse only specific sublists. Can anyone guide me ?

All the help is truly appreciated.
Thanks in advance.


ReverseSelectedBranches.gh (8.4 KB)

Reverse_Every_Second_List_00_tp.gh (11.4 KB)

my approach would be to pick every second branch / path - no matter how long or how complex the path is.
Tree Statistics - will give all pathes
Dispatch - will get every second (ListB)
Tree Branch - will get the corresponding Data
Reverse List - will only Reverse needed the Lists needed
Merge - will “reconstruct” the initial tree

kind regards -tom

2 Likes

Thanks for the response.


The program works fine for one file and other one says no data collected from the positive end.
Can anyone pls tell me what’s wrong?

Thanks in advance.

You have to right click > Simplify your Data input

See this post for further info. about composing masks for the Split Tree component:

-Kevin