Finding the Nearest Meshs all x and y direction

i have requirement to identify the mesh near to any of the selected meshes in x and z direction.

wat is the best approach for this

I would probably do it by simulating spheres or boxes around the mesh and simply compute the the distance.