This was the drawing in which I was doing the tests since I thought I didn't have to use any specific drawing to test it.
I was expecting to select the next object the routine would found in the -x direction from the picked point.
The real usage I wanted it for is already working, which as for it to select a closed polyline surrounding the picked point.
I'm really sorry if I made some confusion because of being too vague and not giving the correct information and wasting your time