How to match the closest points of 3D grids more efficiently?

Hihi,

.

I just learned how to match the closest points in a 2-dimensional list from these two post,

http://dynamobim.org/forums/topic/closets-points-to-a-point-collection/
[Closets points to a point collection?]

http://dynamobim.org/forums/topic/find-index-of-matching-value-in-sublist/
[Find index of matching value in sublist]

.
then I created two nodes, one can get matching indices from selected objects for reordering the original list,

the other one can match the points and create a connected line from the points in the whole node.

.

That just work perfectly well in 2-dimensional list,

but when I’m working on a 3-dimensional grids,

I have to flatten the points lists first, or those two methods won’t function well.

.

Is there a way for those two nodes to only match the specific data from each sublists,

or any other way to make the computation more cost efficiency?

.
the .dyn and .dyf file links are as below: [Dropbox share]
goo.gl/Gz9CEV

.

Either nodes solution or scripts are okay for me.

.

Thanks.

Sorry I can only paste two link in the post.
the .dyn and .dyf file are as below:

FindClosetPointTest20160531.dyn (2.6 KB)

1 Like

WOW!!!

This is awesome!!!

This code makes the nodes running faster than I imagined!!!

Thank you so much!

now I can finished the custom nodes to link the text labels and the objects data from DWG,

I’ll definitely make mention of your help once I published these nodes!!

Thanks again!!