I have several curves that were generated outside of GH. I need to reorder them such and orient them per my sketch below. In the sketch, assume that if two curves appear to lie at the same x coordinate, they are the same. I’ve included a set of curves as a starting point.

Not available for questions? Oh well, you get what you get…

Too late.

The pipes show the original position of the lines after they have been sifted into branches by rounded X values. Disable that preview (cyan group) to better see their adjusted positions, adjacent to each other starting at the X axis.

Correct. So if you were to imagine drawing the lines, you could start by going down one row, then coming back the next row in the opposite direction, then going down the next row in the original direction.

Yeah, I didn’t get that. It means the position of the lines in alternate branches must be sorted in reverse and the other set of alternate branches must be flipped. Not asking much, but you did NOTHING?

P.P.S. And if you want to number the lines like your drawing instead of by branches (columns) as I did, you can simply flatten the input to End Points. (magenta group below)

Well, I did sketch out my request and provide a starting point file which is more than you often get on here.

I took a stab at it but couldn’t figure out how to group the lines according to their x-coordinate value. I understand how to do it now after looking at your solution using the Set components (which I’m not too familiar with).

Thank you for putting the time into this. It’s an opportunity for me to learn more about how these Set components work.

When working with sets (orSort Points), it often pays to round values to a few decimal places (1, 2 or 3) so they aren’t affected by tiny differences. That’s why I added the expression to the pDecon ‘X’ output. I found that pattern in the purple group on the old forum and documented it here:

I don’t think much about how it works anymore but have adapted it many times for similar issues. Just keep a copy of this file handy and copy/paste when needed: MIndex_2017Jan22a.gh (16.5 KB)