; Construct list of strings, when done add "\P" between items, then entmake mtext with content of that list
; In user-speaking language: type rows for the mtext until done, then insert the mtext
(defun c:test ( / ans mtxt-list pt1)
(setq cont T)
(setq mtxt-list (list))
(initget "Finish")
; how to loop to type mtexts and pick points? (loop the loop)
(while cont ; loop to type rows
(setq ans (getstring t "\nType a row for mtext or [Finish] : ")) ; ask for content of the row
(cond
( (or (and (= ans "Finish") mtxt-list ) (and (= ans "FINISH") mtxt-list ) (and (= ans "F") mtxt-list ) (and (= ans "f") mtxt-list ) ) ; check if the list is not nil
(setq cont F) ; stop loop for typing rows
(setq pt1 (getpoint "\nSpecify insertion point for the mtext:"))
(M-Text pt1 (substr (vl-princ-to-string (reverse mtxt-list)) 2 (- (strlen (vl-princ-to-string mtxt-list)) 2)) ) ; removed first and last syntax
)
(t
(setq mtxt-list (cons (strcat (substr "x\P" 2) ans) mtxt-list)) ; how to add "\P" infornt each item?