Maybe a couple of ideas using vlisp
(setq pts (mapcar 'cdr (vl-remove-if '(lambda (x) (/= (car x) 10)) x))) as it is a pline you can get-cordinates directly using VL
(setq txt (cdr (assoc 1 elist))) You can get textstring rather than use entgets.
; pline co-ords example
; By Alan H
(defun getcoords (ent)
(vlax-safearray->list
(vlax-variant-value
(vlax-get-property
(vlax-ename->vla-object ent)
"Coordinates"
)
)
)
)
(defun co-ords2xy ()
; convert now to a list of xy as co-ords are x y x y x y if 3d x y z x y z
(setq numb (/ (length co-ords) 2))
(setq I 0)
(repeat numb
(setq xy (list (nth i co-ords)(nth (+ I 1) co-ords) ))
(setq co-ordsxy (cons xy co-ordsxy))
(setq I (+ I 2))
)
)
; program starts here
(setq co-ords (getcoords (car (entsel "\nplease pick pline"))))
(co-ords2xy)
; look at variable co-ordsxy which is a list of vertices
(princ co-ordsxy)