i have 2 lists of points and i want to get the closest point from list #2 to list #1
Not sure, but isn’t there a OOTB node for this?
Point.ClosestPoint
i thought the same but i cant fine it
I can look up the package for you in about 15 minutes. Unless someone beats me to it
.
maybe Geometry.ClosestPointTo or Geometry.DistanceTo could work
1 Like
Can it be that the list you feed into other has the same Elements as the list you feed into geometry and thus the same location?
List.MinimumItemByKey, where the key is the Geometry.DistanceTo node with only the sample point in it, and the list is the flat list of all other points.
1 Like
You could use DesignScript
point = List.SortByKey(
pts,
Point.DistanceTo(pt, pts)
)["sortedList"][0];
Sorting is not as efficient as scanning a list once with a function, however, unless you are looking at a huge number of points, this will be ok and keeps it to one node

