Help with mtext fill color control

Help with mtext fill color control

DC-MWA
Collaborator Collaborator
693 Views
2 Replies
Message 1 of 3

Help with mtext fill color control

DC-MWA
Collaborator
Collaborator

Heelo,

I have a little lisp I use to toggle background off and on in multileaders and mtext. 

Is there a way to make this lisp set the Background fill color to "drawing background color"

as part of the toggle on process?

Right now it uses random fill color settings?

See below...

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(defun C:toGMask( / ss e cnt dxf_ent)
(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
(command "._draworder" ss "" "front")
(setq ss nil)
(princ)
);end defun toGMask

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

 

thank you in advance for any assistance received.

 

 

0 Likes
694 Views
2 Replies
Replies (2)
Message 2 of 3

Kent1Cooper
Consultant
Consultant

@DC-MWA wrote:

.... 

Is there a way to make this lisp set the Background fill color to "drawing background color" as part of the toggle on process?

Right now it uses random fill color settings?

....


For me, it doesn't use random colors, but simply toggles between having the mask turned on or off, with whatever the color setting is.  Do you want to simply toggle between having it off and on-with-drawing-background-color, or maybe between three values -- having it off, on-with-drawing-background-color, and on-with-some-other-color?  Or some other variety of toggling?

Kent Cooper, AIA
0 Likes
Message 3 of 3

DC-MWA
Collaborator
Collaborator

You are correct.

 

Toggle between having it off and on-with-drawing-background-color when toggled on

would be perfect.

0 Likes