Choose the point to start entering coordinates

How do I choose the face and pick up one end of the piece as a reference for generation of holes?
I improved the macro that was doing by entering the coordinates manually, is to get the mouse click the references and from this point to specify where x and y is the hole?

I'm sending attached the macro if someone can help me.

Hugs

SolidworksApi macros