I found this bit of LISP that can take care of some of my other problems, but I don't know where to make a change so that it will get all of the Mtext in a drawing without prompting to pick it.
Code:
(defun c:StpMtext (/ ss ent1 ent2 tstr1 tstr2)
; Strips Mtext of certain formating
(command "_.undo" "_end")
(command "_.undo" "_group")
(if (setq ss (ssget '((0 . "MTEXT"))))
(while (/= (sslength ss) 0)
(setq ent1 (ssname ss 0))
(setq ent2 (vlax-ename->vla-object ent1))
(setq tstr1 (vlax-get ent2 'TextString))
(setq tstr2 (StripString tstr1))
(vlax-put ent2 'TextString tstr2)
(ssdel ent1 ss)
); while
); if
(command "_.undo" "_end")
(princ)
)
;-------------------------------------
(defun StripString (String / cstr1 cstr2 nString cnt1 tstr1)
; Strips out formation for color, font, height and width.
(setq cnt1 1)
(while (and (setq cstr1 (substr String 1 1)) (> (strlen String) 0))
(if (= cstr1 "\\")
(progn
(setq cstr2 (substr String 2 1))
(if (member (strcase cstr2) '("C" "F" "H" "W"))
(progn
(while (/= (substr String cnt1 1) ";")
(setq cnt1 (1+ cnt1))
); while
(setq String (substr String (1+ cnt1) (strlen String)))
(setq cnt1 1)
); progn
(progn
(if nString
(setq nString (strcat nString (substr String 1 1)))
(setq nString (substr String 1 1))
); if
(setq String (substr String 2 (strlen String)))
); progn
); if
); progn
(progn
(if nString
(setq nString (strcat nString (substr String 1 1)))
(setq nString (substr String 1 1))
); if
(setq String (substr String 2 (strlen String)))
); progn
(princ)
)
[Moderator] - Potential code source: http://www.cadtutor.net/forum/showth...l=1#post278208