Sort elements in tree branch

Hey guys, I was wondering how to sort the branches in the tree in the same order, so that all of the lines are in the same direction?

sorting branches in trees_1

sorting branches in (64.3 KB)

Can you upload the coresponding rhino file also?.

Or alternatively, internalise your data

Ah sorry
Sorting Branches in Tree.3dm (617.3 KB)

Here is my try.sorting branches in (65.8 KB)

Here is another method.
sorting branches in (113.3 KB)

Thanks a lot guys! This helps me a lot