I have a small routine that helps me select an object after I extend a line to it. This object is on a different layer from the line, so I simply find an end point of the line and use it with a filter to select the object of interest.
(setq obj_of_interest (ssget "C" line_end_pt line_end_pt (list (cons 8 obj_layer))))
However, sometimes the result of the command is wrong as it picks up not only the object of interest but other closely drawn objects on obj_layer. I think it has to do with pickbox size. I, of course, can change the pickbox size for the duration of the command to make it work a bit more consistently, but is there a way to do it to be always consistent and truly select only the object that the line is extended to? I want the command to select the closest obj on obj_layer to a point. Thanks