Discarding the last and end sub-branch

How is possible to count the number of sub-branches (for each main branch) and how to discard the last and end sub-branch for each main branch of a tree?

Tree.gh (2.9 KB)

I don’t unerstand what the expected outcome would be just yet but below is a way to get the number of sub-branches:

Tree_number_of_sub-branches.gh (10.5 KB)

1 Like

@martinsiegrist Oh, it is! Smart solution, thank you for sharing!

1 Like

@martinsiegrist Based on your logic but a little bit simplified

1 Like