Rhino Layer List: Extract First Layer with its Sublayers from List

Hey guys,

I am working on a little script that shall read my layer structure in Rhino (Layer Table) and than retrieves all Layers as a List, except my first layer including its sublayers.
I kind of have found a workaround solution I think, but I was wondering if there are more elegant ways to extract a specific layer and its sublayers from a list.

What I need in the end is a list, including all other layers, however, I do not want to just visually explore the list and set the index for splitting, the amount of sublayers can change and the script should autoupdate this.

Looking forward to hearing from your ideas guys!

Best
Max

SublayerExtract.gh (15.7 KB)

used shiftpath instead of flatten

1 Like

Thanks, that looks already smoother!