How to find the objects close to a point

Hi everybody!

I am looking for a way to find the closest objects to a point (with a distance under a certain threshold).
I used to have something similar in Rhino 5 defining the pick_context.m_pick_region.m_xform equal to the inverse of an Xform defining a custom hexahedron. Unfortunately this method was not robust for objects crossing this hexahedral area and the pick_context.m_pick_region.m_xform is private in Rhino6.
Is there a solution that allows me to have this list without iterating on all objects to find the distance from the point?
I ask it because I assume that Rhino have access to an internal spatial indexing of the objects, so I expect its functions to be faster.

Thanks
G.

Hi @gennaro,

I don’t have any really good suggestions at the moment. You might try using RhinoRegionSelect to reduce the possible candidates. Then, calculate the distance to each object until you have what you want.

– Dale