不知道会不会出现其它情况: (defun c:test () (setq ent (car (entsel "\n选择MTEXT文字:"))) (setq dxf (entget ent)) (setq str0 "") (setq txt (cdr (assoc 1 dxf))) (setq txt (vl-string-subst "" "{" txt)) (setq txt (vl-string-subst "" "}" txt)) (while (setq n (vl-string-search ";" txt)) (if (= (setq str (substr txt 1 1)) "\\") (setq txt (substr txt (+ n 2))) (progn (setq str0 (strcat str0 (substr txt 1 1))) (setq txt (substr txt 2)) ) ) ) (setq str0 (strcat str0 txt)) (princ (strcat "当前MTEXT中的文本为: " str0)) (princ) )
|