Searching sublist and find closest point to given point sublist

Hi everyone !

Would greatly appreciate if anyone could help me with this. What I’m trying to do is searching in list 1, find closest point to given point in list 2. The result is list 3 should contain 4 sublist with 1 point for each of 3 first sublists and 3 point for the last sublist. The result format is correct but the return points are wrong. Dynamo doesn’t understand the given point and return the wrong result. I try to flatten list 2 then Dynamo only understand the first point of each sublist in list 2, it doesn’t understand the 2nd and 3rd point in sublist 3 in list 2. Please see the photo below

Hi letuandinh, could you elaborate your question a little bit? I don’t quite understand :-(. Why the result in list 3 should contain 4 sublists?

Hi Yu_Ke,

Because both input lists contain 4 sublists. Hope you can help me to solve this. Attached is the photo showing both input lists

So you have 1 list of points, and you have the other list of points, you want to iterate through the second list, and for each point in the second list, you want to get the closet point in the first list, right?

Is that Geometry.ClosestTo from some package? other input of that node is a list or a single object?

Anyway, following is my version of getting the closest point:

1 Like

That’s exact what I’m trying to do. But can we keep the order of the list instead of sorting. I tried to do you example but the return value is null. Your nodes is a little different from mine.

Geometry.ClosestTo from Clockwork package. “other” input of this node is a list.