Sorting elements in one direction and then in the other

Hi, i’m working on a waffle structure and i would like to organise the different pieces in order. I have extracted the curves from the surfaces of the pieces and i already have two list, one for the piece that are in the x axis direction and one for the other. The problem is that certain row have two pieces, so i would want those pieces to be sorted in the other direction when this is the case. Here is a quick scheme of what i would like to achieve.
Thanks in advance
Waffle Structure sorting.gh (22.7 KB)


There is an error on the scheme i wrote “(2;0;x)” in the bottom left corner but its “(1;0;x)”

Hi @Thepogo

You can use “Member Index”


Waffle Structure sorting.gh (25.5 KB)