How to order points in logical order

Dear Community ,

I want to sort points in the Cartesian coordinates system in a logical order, from smallest to greatest, so that they are next to each other. For example, point 3 should be between points 2 and 4. In my case, point 3 is between points 5 and 6. See the figure below.

Any suggestion how can I sort the point in a logical order.
Here is a screenshot of the GH file

and the GH Code (25.4 KB)
I am looking forward to your answering and many thanks in advance.

Stay healthy and kind regards,

I’m not sure if I fully understand what you’re looking for:

Are you looking for SortPoints component?
Or maybe something like this? (13.6 KB)


Hello Mahdiyar,

thanks for your help. Unfortunatly, this is not the solution to the problem. I probably did not explain what I want accurately enough. If you look to the picture of my model you see point 2 for example. I want that it follows after point 1 and point 3 comes afterward like in clockwise. In my case point, 2 is between points 9 and 10. If it is still unclear for you please ask me.
Iam looking forward to your answering and thanks in advance.

Ultimately what are you trying to achieve?

1 Like


thanks for your suggestion. But this not a solution for the problem.
I will change the points numbers for any kind of shape. So it will be more useful to solve the problem on my code. So for each layer the numer for points changes. You need to install Lunch Box Plug in to have the used components in my model. Here is the link for tha:

Thanks in advance.

Thanks for posting a malfunction in my code.
You need to install the plug in “Lunchbox”
It is for free.

No I don’t. I can skip this thread and still be happy. :sunglasses:

1 Like (12.1 KB)


Okay good for you. But I do not understand why you post this screenshot ?

So that anyone else without LunchBox (and doesn’t want to install it) won’t waste time like I did.

Thanks, but you uploded the privious code again. Could you please share the edidted one.

Well, thanks for your concern about other people’s time. But the Plug-In is not wasting time as you suggest. And there is no need to discuss this anymore. Have a nice day

Sorry, I’ve just edited my post.

your suggestion does not solve my problem. It will be nice if you just use my code (26.1 KB)

1 Like

Okay cool thank you very much
Final Step: As you noticed in the original file I wanted that the sequence of numbers continues. For Example the first layer from 0 to 9 then second layer from 10 to 20 …
I tried to use the flip matrix but it does not work. any other suggestions.
Please try to solve the problem with this modified code. (21.6 KB) (21.3 KB)

1 Like

Many thanks for your help. Stay healthy.