;Tip1455.LSP: MMTEXT.LSP Mtext to Text (c)1998, Jim Houser

(defun C:TTM (/ en ent nent lyr ipt tsz txt sty elv spc ts pt pty
npty ptx ptz npt)
(setq en (car (entsel "\nSelect text to change to MTEXT "))
ent (entget en)
nent (car ent)
)
(setq lyr (assoc 8 ent)
ipt (assoc 10 ent)
tsz (assoc 40 ent)
txt (assoc 1 ent)
sty (assoc 7 ent)
elv (assoc 210 ent)
spc (assoc 67 ent)
)
(setq ts (cdr tsz)
pt (cdr ipt)
pty (cadr pt)
npty (+ ts pty)
ptx (car pt)
ptz (caddr pt)
npt (list ptx npty ptz)
ipt (cons 10 npt)
)
(setq nent
(list nent (cons 0 "MTEXT")
(cons 100 "AcDbEntity")
spc
lyr
(cons 100 "AcDbMText")
ipt
tsz
txt
(cons 41 (* ts 30.0))
sty
(cons 71 1)
(cons 72 1)
(cons 11 (list 1.0 0.0 0.0))
elv
))
(entdel en)
(entmake nent)
(princ)
)
(defun C:MTT (/ en ent nent lyr ipt tsz txt sty elv spc ts pt pty
npty ptx ptz npt)
(setq en (car (entsel "\nSelect MTEXT to change to regular text "))
ent (entget en)
nent (car ent)
)
(setq lyr (assoc 8 ent)
ipt (assoc 10 ent)
tsz (assoc 40 ent)
txt (assoc 1 ent)
sty (assoc 7 ent)
elv (assoc 210 ent)
spc (assoc 67 ent)
)
(setq ts (cdr tsz)
pt (cdr ipt)
pty (cadr pt)
npty (- pty ts)
ptx (car pt)
ptz (caddr pt)
npt (list ptx npty ptz)
ipt (cons 10 npt)
)
(setq nent
(list nent (cons 0 "TEXT")
(cons 100 "AcDbEntity")
spc
lyr
(cons 100 "AcDbText")
ipt
tsz
txt
(cons 50 0.0)
(cons 41 1.0)
(cons 51 0.0)
sty
(cons 71 0)
(cons 72 0)
(cons 11 (list 0.0 0.0 0.0))
elv
(cons 73 0)
))
(entdel en)
(entmake nent)
(princ)
)
(C:MTT)

Advertisements