The MtextMask.lsp I found here:
The FixMtext.lsp I found here:
Thanks for any help.
Solved! Go to Solution.
Solved by pbejse. Go to Solution.
@msarqui wrote:Hello guys.
I wish someone could put together these two routines that I found here in the Autodesk discussion groups.I think it would be helpful if the two could be merged.
Easiest way to do that with minimal changes to the orignal codes:
Change this line <FixMText>
(if ss (princ (strcat "\nNumber of mtext objects modified: " (itoa cnt))) )
to
(if ss (progn (princ (strcat "\nNumber of mtext objects modified: " (itoa cnt))) (sssetfirst nil ss)) )
Then use this:
(defun c:CFM () (setvar 'pickfirst 1) (c:FMT) (c:MTM) )
Make sure both Lisp are loaded
command: CFM
Thank you very much my friend,
It works pretty well now.
I'd like to ask you something. I realized that the Mtext Boxes routine can fit very well the width of the text. But in relation to the height that does not happen. There is the possibility to fix this?
Thanks!
@msarqui wrote:Thank you very much my friend,
It works pretty well now.
I'd like to ask you something. I realized that the Mtext Boxes routine can fit very well the width of the text. But in relation to the height that does not happen. There is the possibility to fix this?
Thanks!
[again to minimize changes on the orignal code]
Along with the previous mod.
(defun c:MTH (/ ent ss i) (if (setq ss (ssget '((0 . "MTEXT")))) (repeat (setq i (sslength ss)) (setq ent (entget (ssname ss (setq i (1- i))))) (entmod (subst (cons 46 (cdr (assoc 40 ent))) (assoc 46 ent) ent) ) ) ) (sssetfirst nil ss) )
(defun c:CFM () (setvar 'pickfirst 1) (c:FMT) (c:MTH) (c:MTM) )
Keep it mind, there are cases that the MTEXT properties are so messed up both codes for width and height wont work at all.
EDIT: mispelled variable name
for multi line Mtext <untested>
(defun c:MTH (/ ent ss i) (if (setq mpl 1 ss (ssget '((0 . "MTEXT")))) (repeat (setq i (sslength ss)) (setq ent (entget (ssname ss (setq i (1- i)))) str (cdr (assoc 1 ent))) (while (setq n (vl-string-search "\\P" str)) (setq str (substr str (+ n 3)) mpl (1+ mpl)) ) (entmod (subst (cons 46 (* (* (cdr (assoc 40 ent)) mpl) 1.5)) (assoc 46 ent) ent) ) ) ) (sssetfirst nil ss) )
It's really weird. Sometimes it works for the heigth, sometimes not. But okay, the most important was to unite the two routines and they are working. Thank you very much!
@msarqui wrote:It's really weird. Sometimes it works for the heigth, sometimes not. But okay, the most important was to unite the two routines and they are working. Thank you very much!
You are welcome
Glad it work for you msarqui, I did not notice that behavior too.I will look into it later
Cheers