Simple question: Reordering / Referencing Lists


Really simple question here, I’m getting back into GH after a short break and can’t remember how to reorder / reference one list against another.

As in the picture, I have reordered my “points unordered” list to match up to the curve they are nearest to. Each of these points shared an index with a correlating list of values in “Points Values Unordered”. How do I now reorder that list so that I can then apply each value to its nearest curve?

Any help / advice would be very much appreciated.


LC (3.5 MB)

Looking closer I realise I’ve completely misunderstood what the nearest point is doing here.

I’ve taken a step back and realised what Im trying to do is harder than I thought.

How can I re-order my points and values to correlate with the nearest line / contour?
[At present the wrong contours are being moved]


image (3.5 MB)

Is this what you are after?

LC (3.5 MB)

Hi Kim,

Thanks very much for that, it seems to have done the job at this scale. Now that I have to scale this up to nearly 2000 lines and contours I’ve plugged it in and left it running. As it has to reference each point against each line to find the closest, I imagine it will take quite a while.

If I just let it do its thing, is waiting the best option here or is there a better way to deal with large datasets?

If you don’t mind to use plugins, Peacock has a user object namedClosest Geometry and probably it will take less time than my previous posting, but not sure it can save how much time for your case…

If you want much faster solution, then you’ll probably need C# scripting…