Selecting the shortest edge of a closed curve in grasshopper

It seems like a simple task. All I want to do is to select the shortest edge of multiple closed curves in grasshopper. I deconstructed them, sorted them, picked up the first one on the list and now I want to gain its index for another selection which would finally be the shortest one in the first list but “item Index” is giving -1 for all the curves. What am I doing wrong?

I also tried item index with a bunch of numbers to see if it shows the same behavior and yes it gives -1 there too

Shortest edge.gh (22.6 KB)

Not sure why item index fails, though you can create a list of indices, sort them as well and pick the first one:

Shortest_edge_02.gh (19.9 KB)

1 Like

Something like this should work with Item Index.

See the post below for a better explanation (its not a bug).

1 Like


@Abolghasem_Raeis_Sam ,You can also try this method. Use the Node “Find Similar member” under the Sets>>Sets tab

1 Like

I didn’t know what is the A parameter in the sort list component. Now I get it. Thank you so much

all right now I got the difference between item index and member index
Thanks alot

1 Like