Something like this, perhaps? Minimally tested:
(defun C:TEST (/ ss Etxt Ntxt)
(if
;; picked 2 Text objects, one of which starts with E & at least
;; one number, and the other with N & at least one number?
(and
(setq ss (ssget '((0 . "TEXT") (1 . "E#*,N#*"))))
(= (sslength ss) 2)
(setq Etxt (ssname (ssget "_P" '((1 . "E*"))) 0))
(setq Ntxt (ssname (ssdel Etxt ss) 0))
(wcmatch (getpropertyvalue Ntxt "TextString") "N*")
); and
(command "_.line" ; then
"_non"
(strcat
(substr (getpropertyvalue Etxt "TextString") 2)
","
(substr (getpropertyvalue Ntxt "TextString") 2)
); strcat
); command [leaves you in it to finish]
(prompt "\nDid not select correct combination of two Text objects."); else
); if
(prin1)
)
It doesn't matter how you pick the two, nor if picked individually, in which order you pick them.
It leaves you in the Line command that it started from those coordinates, to go where you want with it, to any number of segments.
It requires capital E and N, but could be made to allow lower-case.
It assumes the numerical parts of the Text content will be in a format that AutoCAD can take as X,Y input -- for example no thousands comma separator, but decimals or even fractions [formatted correctly] are OK.
Kent Cooper, AIA