The idea of pasting the copied content into the drawing, rather than into the Command line, that @komondormrex used in Message 19, would not have occurred to me, but is just the way of getting multi-line content in that I wondered whether someone would think of.
Doing that, I found that Exploding the resulting Mtext as they did causes complications, because the tabs get changed to varying numbers of spaces [not even the same number in the same position in different lines]. And if it's sufficiently longer, pulling the text content out of entity data would be complicated by its being split up among more than one data entry [DXF codes 3 and 1, not just 1 when it's short enough].
BUT the (getpropertyvalue) approach for getting the text content keeps it all in one string no matter how long, and preserves the tabs, and has new-line characters inside the one string, instead of being separate strings for each line.
So here's a way to use those benefits, again starting with your having first put content from the other program [as in your xy.txt file] into the clipboard:
(defun C:TEST (/ beforeTab afterTab afterNL str X+ X Y+ Y pts)
(defun beforeTab (str) (substr str 1 (vl-string-position 9 str)))
(defun afterTab (str) (substr str (+ (vl-string-position 9 str) 2)))
(defun afterNL (str) (substr str (+ (vl-string-position 10 str) 2)))
(command "_.pasteclip" (getvar 'viewctr))
(setq str (getpropertyvalue (entlast) "Text"))
(entdel (entlast))
(while (vl-string-position 10 str); still any new-line character(s)?
(setq
X+ (afterTab str) X (beforeTab X+)
Y+ (afterTab X+) Y (beforeTab Y+)
pts (cons (list (atof X) (atof Y)) pts)
str (afterNL X+); to next line [skip UTM etc.]
); setq
); while
(setq ; for last line remaining
X+ (afterTab str) X (beforeTab X+)
Y+ (afterTab X+) Y (beforeTab Y+)
pts (cons (list (atof X) (atof Y)) pts)
); setq
(command "_.pline")
(mapcar 'command pts)
(command "_close" "_.zoom" "_object" (entlast) "")
(prin1)
)
[Turn off running Osnap first, or that can be built in, along with other usual features.]
Kent Cooper, AIA