# Longest distances between curves

Hello everyone,

I’m working on a script where I need to find the longuest distances between two separate curves.
I succeeded to find the longuest one. But what I also want is to find the 2nd longuest distance, or the 4th one, or the 20th one etc. And i want to find it with a list of numbers that I will create with the panel tool.
Of course the longuest one will be n°1 or n°0 on that list.

So I’m requesting your help here so that we can see together if there’s a solution.

Here’s the script.

Thank you in advance and please take care of yourself during this Covid-19 crisis.

Technically, the second longest line will be infinitesimally close to the first, most likely. But since you’re not using curves, but points on it, it’s a different problem. In that case, you have to measure the distance of all the points to all the points, using [Cross Reference] for example, and then sort them with [Sort List] and reverse the order to have the longest one first.

1 Like

Tried it! Worked perfectly, thanks a lot.
Have a nice week.