HELP - GH expert - selecting closest boxes in couple

Hi GH Expert,

I’ve a question for everyone want to experiment:

I made this script:

20251013_seleziona coppie di traverse.gh (9.7 KB)

I’ve thousand block and I need to select the 2 of them that are closest. (the file should exaplin it better) This is the file: Samples.3dm (2.9 MB)

Do you have other ideas on how to do it in legacy Grasshopper?
Thanks


closest_boxes.gh (91.6 KB)

this might be a way

20251013_seleziona coppie di traverse_inno.gh (99.8 KB)

20251013_seleziona coppie di traverse_jvs01.gh (16.7 KB)