I’m trying to figure out an efficient way to input a set of lines in GH, and then sort them in order.
I have uploaded two images to demonstrate the sorting structure I am trying to achieve. In essence, even though there is branching lines, I’d like to be able to navigate the lines in some known order.
One way I think I can approach this is by using an origin point to the bottom left of the lines to find the starting line. The I could loop through the list of lines to see if they share any of the start or end points from the starting line, then if so, add that next and repeat. I would also like to be able to do this if some of the networks are open, or closed (like the two uploaded images).
In the file you will see two Python components. The one that is currently connected (Sort by Location and Point list) is the closest to what you asked for, but depending on your lines, it might not always return an obvious order.
It only has a few options for sorting at the moment. Right now I just have: X, Y, Z, X-y (where X is dominant, then Y), and Y-x (where Y is dominant, then X). I also have positive and negative values for the sort direction.