Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Textmask Default Masktype and Color

11 REPLIES 11
Reply
Message 1 of 12
mugenlude
468 Views, 11 Replies

Textmask Default Masktype and Color

I'm a .lsp novice and I could use some help.

I'm looking to make a .lsp that will set the default masktype and color of my textmask.

After examining the code I think I need to set the MTYPE and MCOLOR_NEW variables, but I'm not sure. And if these are the variables I need to set, I don't know how to set them. 😃
11 REPLIES 11
Message 2 of 12
Anonymous
in reply to: mugenlude

If your mask type is Wipeout, then in TEXTMASK.LSP (an Express Tool), edit
the following part:

(command "_.wipeout" "_Polyline" (entlast) "_yes") ; create
wipeout entity

(setq WIPOUT (entlast))

(command "_.change" WIPOUT "" "_Prop" "_Layer" TXTLAY "") ; and
set its layer

(acet-ucs-cmd (list "_previous")) ; reset the ucs

(entmake TXT) ; recreate text
(setq TXT (entlast)) ; such that it's on top




to look like this:


(command "_.wipeout" "_Polyline" (entlast) "_yes") ; create
wipeout entity

(setq WIPOUT (entlast))

(command "_.change" WIPOUT "" "_Prop" "_Layer" TXTLAY "") ; and
set its layer

(command "_.chprop" WIPOUT "" "c" "255" ""); THIS IS THE ADDED
LINE OF CODE.

(acet-ucs-cmd (list "_previous")) ; reset the ucs

(entmake TXT) ; recreate text
(setq TXT (entlast)) ; such that it's on top


And if Wipeout is your mask of choice




--
Bill DeShawn
bdeshawn@nospamsterling.net
http://my.sterling.net~bdeshawn

wrote in message news:5062831@discussion.autodesk.com...
I'm a .lsp novice and I could use some help.

I'm looking to make a .lsp that will set the default masktype and color of
my textmask.

After examining the code I think I need to set the MTYPE and MCOLOR_NEW
variables, but I'm not sure. And if these are the variables I need to set,
I don't know how to set them. 😃
Message 3 of 12
mugenlude
in reply to: mugenlude

BIll I apologize and thank you for writing that up, I had to re-write my thread because I included some copywrighted code and I forgot to indicate the defaults I wanted.

Masktype = Solid
Color = 200

Before I started this thread I attempted some code similar to yours, my problem comes in after I specify the Solid Masktype. When you choose Solid a dialog window opens and requests a color. The commands that I was using didn't work in the dialog box.
Message 4 of 12
EC-CAD
in reply to: mugenlude

Here is a sample..modified.

.....Comment out this section...
;((= EN "Masktype")
;(setq MSKLOOP T)
;(while MSKLOOP
;(princ (acet-str-format "\nMask type currently set to %1" MTYPE))
;(if (= WIPOUT 0)
;(progn
;(initget "3dface Solid _3dface Solid")
;(setq ANS (getkword (acet-str-format "\nSpecify entity type to use for mask [3dface/Solid] <%1>: " MTYPE )))
;)
;(progn
;(initget "Wipeout 3dface Solid _Wipeout 3dface Solid")
;(setq ANS (getkword (acet-str-format "\nSpecify entity type to use for mask [Wipeout/3dface/Solid] <%1>: " MTYPE )))
;)
;)
;(cond
;((and (= ANS "Wipeout") (not WIPOUT))
;(princ "\nLoading WIPEOUT for use with TEXTMASK...")
;(setq WIPOUT 1)
;(setq MSKLOOP nil)
;(acet-setvar (list "acet_textmask_masktype" ANS 3)) ; Save the mask type
;)
;((or (= ANS "Solid") (and (not ANS) (= MTYPE "Solid")))
;(setq MCOLOR_NEW (acad_colordlg MCOLOR))
;(if (and MCOLOR_NEW) ; If OK was selected
;(progn
;(acet-setvar (list "acet_textmask_masktype" ANS 3)) ; Save the mask type
;(acet-setvar (list "acet_textmask_maskcolor" MCOLOR_NEW 3)) ; and the color
;)
;)
;(setq MSKLOOP nil)
;)
;((not ANS)
;(setq MSKLOOP nil)
;)
;(T
;(acet-setvar (list "acet_textmask_masktype" ANS 3)) ; If setvar function exists use it
;(setq MSKLOOP nil)
;)
;)
;)
;)

Add this................
(setq MTYPE "Solid")
(setq MCOLOR_NEW 200)
(acet-setvar (list "acet_textmask_masktype" MTYPE 3)) ; Save the mask type
(acet-setvar (list "acet_textmask_maskcolor" MCOLOR_NEW 3)) ; and the color
...............

Bob
Message 5 of 12
mugenlude
in reply to: mugenlude

That doesn't seem to be working. I'm stuck in the 'Select text objuects to mask or [Masktype/Offset]"

Here is the command line: (the ** are my comments)

Command: _textmask
Current settings: Offset factor = 0.350000, Mask type = Solid, Mask color = 200
Select text objects to mask or [Masktype/Offset]:
1 found **(this is the text I selected)**
Current settings: Offset factor = 0.350000, Mask type = Solid, Mask color = 200
Select text objects to mask or [Masktype/Offset]: **(right-click or enter to end selection at this point)**
Current settings: Offset factor = 0.350000, Mask type = Solid, Mask color = 200
Select text objects to mask or [Masktype/Offset]:

If I continue to right-click or enter it will just continue to give me the same line.
Message 6 of 12
EC-CAD
in reply to: mugenlude

It's probably looping, waiting for :
(setq MSKLOOP nil)
Add that line, try again.

Bob
Message 7 of 12
EC-CAD
in reply to: mugenlude

Mugenlude,
If that doesn't do it,, you could E-Mail me the
Lisp .. nospam.ec-cad@centurytel.net
Remove the 'nospam' and the "."

Bob
Message 8 of 12
mugenlude
in reply to: mugenlude

Where would I add that line, I tried both before and after the code you gave me.

I'm not quite sure which loop I'm trying to end.
Message 9 of 12
EC-CAD
in reply to: mugenlude

You would add it just before:
(setq MTYPE "Solid")

But, I'm not sure what you have at this point.

Bob
Message 10 of 12
mugenlude
in reply to: mugenlude

YGM Thanks. 😃
Message 11 of 12
mugenlude
in reply to: mugenlude

Got it to work with this... It accomplishes what I want, but the option for a wipeout isn't available any longer, basically you can't change the masktype to anything else. This works for me because the wipeout command doesn't work with our .pdfs, so eliminating it is OK.

Thanks Bob

((= EN "Masktype")
(setq MSKLOOP nil)
(setq MTYPE "Solid")
(setq MCOLOR_NEW 200 MCOLOR 200)
(acet-setvar (list "acet_textmask_masktype" MTYPE 3)) ; Save the mask type
(acet-setvar (list "acet_textmask_maskcolor" MCOLOR_NEW 3)) ; and the color
); end cond
Message 12 of 12
EC-CAD
in reply to: mugenlude

You are Welcome.
Glad to help.
:)

Bob
http://www.bobscadshop.com

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost