@DC-MWA ,
I have this one laying around. Should do the trick.
EDIT:
I was perhaps a bit hasty. My approach merely APPLIES a background mask. It does not toggle. Maybe I can configure something new real quick...
EDIT 2:
Ok, I have updated the code below to TOGGLE. Give that a go.
(defun c:BM ( / ss e cnt)
(prompt "\nSelect objects to toggle background mask: ")
(if (setq ss (ssget '((0 . "MULTILEADER,MTEXT"))))
(progn
(repeat (setq cnt (sslength ss))
(setq e (ssname ss (setq cnt (1- cnt))))
(if (eq "MTEXT" (cdr (assoc 0 (entget e))))
(progn
(setpropertyvalue e "BackgroundFill" (abs (1- (getpropertyvalue e "BackgroundFill"))))
(setpropertyvalue e "UseBackgroundColor" (abs (1- (getpropertyvalue e "UseBackgroundColor"))))
);progn
(setpropertyvalue e "MText/BackgroundFill" (abs (1- (getpropertyvalue e "MText/BackgroundFill"))))
);if
);repeat
(command "_.REGEN")
(prompt "\nBackground Masks have been Toggled.")
);progn
;else
(prompt "\nMust select either a Multileader or MText.")
);if
(setq ss nil)
(princ)
);defun
Best,
~DD