ReOrganisizing curves index by another sorted list (their middle points)

Hey, this is my first post on forum so I’m sorry for any further mistakes I could do.

I was trying to find the answer for couple of days but I have no idea what are the words I need to use precisely to find the answer that can be helpful for me.

Long story short.

Im currently working on a basic model with attractors, which in this case help me to cut previously made curves. My work-logic is to 1. make these curves - 2. give them a referent points (curve middle) - 3. sort them (curve middle points) by the logic I have described in the algorithm - 4. and relay the sorted points to those curves.

My question is - is it possible to “name” those curves and reorganized them by the new index.

Curves (mid points) sorted by standard grasshopper logic - (I’ve moved the curve by series of Z vectors).

The same mid points, but sorted by my algorithm - to different group of points.

My main problem is I only sort the points not the curves which I care the most in this example.

Thank you in advance for any answers. :slight_smile:

Please share the minimal version of your gh file with the geometry internalised.

This guideline will help you get better help.