Hello,
I found two amazing routines to make and fit the background mask in mtext.
The Txtboxwidth.lsp I found here :
http://autocadtips.wordpress.com/2011/08/13/autolisp-text-box-width/
The MtextMask.lsp I found here :
http://www.cadtutor.net/forum/showthread.php?42622-Text-mask-wipeout-replacement-by-background-mask
The Txtboxwidth.lsp make the bounding box fit to the text.
The MtextMask.lsp put a background mask in the select mtext with a prompt to choose settings like the color and the offset of the border.
Both are perfect if used separate but my issue is to merge this two routines. I have a very, very basic knowledge of the lisp so I tryed this:
;------------------------------------
;shortcut
(defun c:MMT ()
(setvar 'pickfirst 1)
(c:TxtBoxWidth)
(c:Mtm)
)
;------------------------------------
but I have been prompted two times to select the same mtext.
I would like to select the mtext just one time.
Could someone please merge this two routines in only one?
Thanks.
Solved! Go to Solution.
Solved by pbejse. Go to Solution.
You are having two different selection sets, this is the reason why you have to select "MTEXT" entities two times.
I think that the easiest way (not the best) to combine these two, is to set selection set from the first one to be the second one.
But be careful because selection sets are set to be local variables, or at the end of the routine are set to be nil.
And you will probably need to set selection sets to nil after combining them...
I hope this will give you a hint,
you can find a lot of explanations how to use selection sets on this forum, or in autocad help.
Hi dicra,
Thanks for your time but, as I said, my knowledge of LISP is very, very basic and I have no idea how to do what you are saying. Sorry...
@msarqui wrote:
Hello,
I found two amazing routines to make and fit the background mask in mtext.
The Txtboxwidth.lsp I found here :
The MtextMask.lsp I found here :
I would like to select the mtext just one time.
Could someone please merge this two routines in only one?
Thanks.
No need to merge:
(defun c:wrap () (C:TXTBOXWIDTH) (sssetfirst nil (ssget "_P")) (C:MTM) )
Make sure PICKFIRST is set to 1
HTH
Hello,
I see this problem has been solved and you are able to both shrink wrap and mask mtext in one step, however I am not versed enough in lisp to understand how to implement the stated solution. Would either of you be willing to share the new corrected lisp(s) or further explain exactly where/how the solution lisp code should be inserted and into which lisp routine?
Thank in advance!
Nevermind, I see now that it is it's own lisp routine that references the others. Once it's loaded it works like a charm, thanks!