There was a similar topic that Steal text inside polyline. Not really much tweaking, but here:
(defun c:polypoint ( / *error* acadobj activeundo adoc catch insidepoly msp osm pls pt ray)
(defun *error* ( msg )
(setvar 'osmode osm)
(if (and (eq (type ray) 'vla-object) (null (vlax-erased-p ray))) (vl-catch-all-apply 'vla-delete (list ray)))
(vla-EndUndoMark adoc)
(if (not (wcmatch (strcase msg T) "*break*,*cancel*,*exit*"))
(princ (strcat "Error: " msg))
)
)
(defun insidepoly (pt ent ray / ints)
(setq ints (vlax-invoke (vlax-ename->vla-object ent) 'intersectwith ray acExtendNone))
(if (eq (rem (length ints) 6) 3) ent)
)
(setq acadobj (vlax-get-acad-object)
adoc (vla-get-ActiveDocument acadobj)
msp (vla-get-ModelSpace adoc)
activeundo nil)
(if (= 0 (logand 8 (getvar "UNDOCTL"))) (vla-StartUndoMark adoc) (setq activeundo T))
(setq osm (getvar 'osmode))
(setvar 'osmode 0)
(setq pt (progn (initget 1) (getpoint "\nSpecify point: "))
ray (vla-AddRay msp (vlax-3d-point pt) (vlax-3d-point (polar pt 0 1)))
pls (ssget "_X" '((0 . "LWPOLYLINE") (70 . 1)))
)
(if
(setq catch
(vl-some
'(lambda (x)
(insidepoly pt x ray)
)
(JH:selset-to-list pls)
)
)
(sssetfirst nil (ssadd catch))
)
(vla-delete ray)
(setvar 'osmode osm)
(if activeundo nil (vla-EndUndoMark adoc))
(princ)
)
(defun JH:selset-to-list (selset / lst iter) ; Returns all entities within a selection set into a list.
(if selset
(repeat (setq iter (sslength selset))
(setq lst (cons (ssname selset (setq iter (1- iter))) lst))
)
)
)