PDA

View Full Version : Background Mask



pants
2009-04-24, 07:39 PM
Hi,

I would like to know if anyone knows how to turn off and on the background text mask without having to edit the text in the properties dialog box.

Is their a SETVAR of any type in Acad 2009

Thanks

Love this Software

lpseifert
2009-04-24, 08:59 PM
There's no system variable that I know, but this will turn the background mask of selected Mtext on/off.


;;;Turns Background mask on/off LPS 2009
(defun c:BGON (/ ss1 obj num cnt)
(vl-load-com)
(setq ss1 (ssget '((0 . "mtext")))
num (sslength ss1)
cnt 0)
(repeat num
(setq obj (vlax-ename->vla-object (ssname ss1 cnt)))
(vlax-put-property obj 'BackgroundFill :vlax-true)
(setq cnt (1+ cnt))
)
(vl-cmdf "_draworder" ss1 "" "f")
(princ)
)

(defun c:BGOFF (/ ss1 obj num cnt)
(vl-load-com)
(setq ss1 (ssget '((0 . "mtext")))
num (sslength ss1)
cnt 0)
(repeat num
(setq obj (vlax-ename->vla-object (ssname ss1 cnt)))
(vlax-put-property obj 'BackgroundFill :vlax-false)
(setq cnt (1+ cnt))
)
(princ)
)

dzatto
2009-04-24, 09:08 PM
Here's another one.

http://cadtips.cadalyst.com/2d-editing/turn-text-object-background-masks-and

Tom Beauford
2009-04-24, 09:13 PM
Hi,

I would like to know if anyone knows how to turn off and on the background text mask without having to edit the text in the properties dialog box.

Is their a SETVAR of any type in Acad 2009

Thanks

Love this Software
There's a few lisp routines out there. I use MTMask.lsp (http://discussion.autodesk.com/forums/thread.jspa?threadID=653614), it has two commands MTUnmask and MTMask.

michaelrniemi
2010-10-13, 06:20 PM
There's no system variable that I know, but this will turn the background mask of selected Mtext on/off.


;;;Turns Background mask on/off LPS 2009
(defun c:BGON (/ ss1 obj num cnt)
(vl-load-com)
(setq ss1 (ssget '((0 . "mtext")))
num (sslength ss1)
cnt 0)
(repeat num
(setq obj (vlax-ename->vla-object (ssname ss1 cnt)))
(vlax-put-property obj 'BackgroundFill :vlax-true)
(setq cnt (1+ cnt))
)
(vl-cmdf "_draworder" ss1 "" "f")
(princ)
)

(defun c:BGOFF (/ ss1 obj num cnt)
(vl-load-com)
(setq ss1 (ssget '((0 . "mtext")))
num (sslength ss1)
cnt 0)
(repeat num
(setq obj (vlax-ename->vla-object (ssname ss1 cnt)))
(vlax-put-property obj 'BackgroundFill :vlax-false)
(setq cnt (1+ cnt))
)
(princ)
)


Is there a way to modify this so that you don't have to select the objects? It will just perform the on or off automatically to all mtext?

Tom Beauford
2010-10-13, 07:24 PM
Change
(ssget '((0 . "mtext")))
to
(ssget "X" '((0 . "mtext")))

michaelrniemi
2010-10-13, 09:39 PM
Thanks Tom for the reply!

designtechsd543687
2014-06-12, 04:09 PM
Thank you for saving me time on the clicks. Can is there a way you can adjust the background offset to 1.00?


There's no system variable that I know, but this will turn the background mask of selected Mtext on/off.


;;;Turns Background mask on/off LPS 2009
(defun c:BGON (/ ss1 obj num cnt)
(vl-load-com)
(setq ss1 (ssget '((0 . "mtext")))
num (sslength ss1)
cnt 0)
(repeat num
(setq obj (vlax-ename->vla-object (ssname ss1 cnt)))
(vlax-put-property obj 'BackgroundFill :vlax-true)
(setq cnt (1+ cnt))
)
(vl-cmdf "_draworder" ss1 "" "f")
(princ)
)

(defun c:BGOFF (/ ss1 obj num cnt)
(vl-load-com)
(setq ss1 (ssget '((0 . "mtext")))
num (sslength ss1)
cnt 0)
(repeat num
(setq obj (vlax-ename->vla-object (ssname ss1 cnt)))
(vlax-put-property obj 'BackgroundFill :vlax-false)
(setq cnt (1+ cnt))
)
(princ)
)

designtechsd543687
2014-06-12, 04:34 PM
Is there a variable in the routine to change the background mask offset distance?


There's no system variable that I know, but this will turn the background mask of selected Mtext on/off.


;;;Turns Background mask on/off LPS 2009
(defun c:BGON (/ ss1 obj num cnt)
(vl-load-com)
(setq ss1 (ssget '((0 . "mtext")))
num (sslength ss1)
cnt 0)
(repeat num
(setq obj (vlax-ename->vla-object (ssname ss1 cnt)))
(vlax-put-property obj 'BackgroundFill :vlax-true)
(setq cnt (1+ cnt))
)
(vl-cmdf "_draworder" ss1 "" "f")
(princ)
)

(defun c:BGOFF (/ ss1 obj num cnt)
(vl-load-com)
(setq ss1 (ssget '((0 . "mtext")))
num (sslength ss1)
cnt 0)
(repeat num
(setq obj (vlax-ename->vla-object (ssname ss1 cnt)))
(vlax-put-property obj 'BackgroundFill :vlax-false)
(setq cnt (1+ cnt))
)
(princ)
)

Tom Beauford
2014-08-06, 03:36 PM
Lee Mac's routine modifies the entity DXF code 45 which is the background mask offset distance.
http://www.lee-mac.com/mask.html
I don't think you can do the same modifying the object.