Visual LISP, AutoLISP and General Customization

Reply
Valued Contributor
mugenlude
Posts: 88
Registered: ‎04-28-2003
Message 1 of 12 (73 Views)

Textmask Default Masktype and Color

73 Views, 11 Replies
01-18-2006 12:13 PM
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. =)
*Bill DeShawn
Message 2 of 12 (73 Views)

Re: Textmask Default Masktype and Color

01-18-2006 07:56 PM 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. =)
Valued Contributor
mugenlude
Posts: 88
Registered: ‎04-28-2003
Message 3 of 12 (73 Views)

Re: Textmask Default Masktype and Color

01-19-2006 06:55 AM 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.
Distinguished Contributor
EC-CAD
Posts: 5,929
Registered: ‎12-12-2003
Message 4 of 12 (73 Views)

Re: Textmask Default Masktype and Color

01-19-2006 07:28 AM 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 )))
:smileywink:
;(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 )))
:smileywink:
:smileywink:
;(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
:smileywink:
;((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
:smileywink:
:smileywink:
;(setq MSKLOOP nil)
:smileywink:
;((not ANS)
;(setq MSKLOOP nil)
:smileywink:
;(T
;(acet-setvar (list "acet_textmask_masktype" ANS 3)) ; If setvar function exists use it
;(setq MSKLOOP nil)
:smileywink:
:smileywink:
:smileywink:
:smileywink:

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
Valued Contributor
mugenlude
Posts: 88
Registered: ‎04-28-2003
Message 5 of 12 (73 Views)

Re: Textmask Default Masktype and Color

01-19-2006 08:33 AM 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.
Distinguished Contributor
EC-CAD
Posts: 5,929
Registered: ‎12-12-2003
Message 6 of 12 (73 Views)

Re: Textmask Default Masktype and Color

01-19-2006 08:53 AM in reply to: mugenlude
It's probably looping, waiting for :
(setq MSKLOOP nil)
Add that line, try again.

Bob
Distinguished Contributor
EC-CAD
Posts: 5,929
Registered: ‎12-12-2003
Message 7 of 12 (73 Views)

Re: Textmask Default Masktype and Color

01-19-2006 09:50 AM 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
Valued Contributor
mugenlude
Posts: 88
Registered: ‎04-28-2003
Message 8 of 12 (73 Views)

Re: Textmask Default Masktype and Color

01-19-2006 10:08 AM 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.
Distinguished Contributor
EC-CAD
Posts: 5,929
Registered: ‎12-12-2003
Message 9 of 12 (73 Views)

Re: Textmask Default Masktype and Color

01-19-2006 11:05 AM 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
Valued Contributor
mugenlude
Posts: 88
Registered: ‎04-28-2003
Message 10 of 12 (73 Views)

Re: Textmask Default Masktype and Color

01-19-2006 11:13 AM in reply to: mugenlude
YGM Thanks. =)

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community