Sorting random drawn curves in order along X direction

Hi Everyone,

I’m just starting to learn grasshopper and I need a little bit of help here :sweat_smile:. I am basically trying to get a projected length to a curve, in a list format (in first picture) The problem is, I have 190 curves that were drawn in different order so the order of the list is messed up. Image 2 shows a snippet of the drawing from curve number 47 to 49. Is there a way I can arrange the item index without having to change the curves? Starting from 0 to 190. Currently it starts as 30,1,2,3,31,5,32,4…
The curves are all aligned in X direction btw if that helps?

Hi @Tlmn! Not entirely sure what you are trying to do, but here’s how I would sort referenced curves in Grasshopper. Hope that helps (11.9 KB)

If I understand you correctly, you just want to sort your lines along the X-Axis.

All you need to do is get a point on each of your lines and use the Sort Points component.

I’ve used the End Points component, but you could use any component that gives you a point on each of your lines. (11.9 KB)


Many thanks, I’ll see if that works