Community
AutoCAD Forum
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How do I change a default answer within the Layer Command?

6 REPLIES 6
Reply
Message 1 of 7
perkins76
293 Views, 6 Replies

How do I change a default answer within the Layer Command?

How do I change a default answer within the Layer Command?

 

Specifically, I am writing a Lisp to that makes our standard layers.  When it makes the layer the 1st time it is run, it works fine.  Any subsequent times I get a prompt when giving the layer a description that asks me if I want to replace the existing Description.  The default answer is "NO".  How to i surpress that promt or change the default to "YES"?  I can;t answer that question in my code, because it is not asked the 1st time it is run.

 

Here is a sample of what I have written for each layer.  I am open to suggestions (i.e. if/then) if it not too complicated.  I am a novice when it comes to Lisp.

 

 

6 REPLIES 6
Message 2 of 7
Kent1Cooper
in reply to: perkins76

This has come up before -- I'll let you do the Searching, which I suggest you do in the "Search the Community" Search window rather than just in this Board, because the answer may be under some other version range, or in the Customization Forum.

Kent Cooper, AIA
Message 3 of 7
Anonymous
in reply to: perkins76

Try to add a check, to see if the layer already exists, if it doesn't exist then create it.

 

(if (not (tblsearch "LAYER" "LAYERNAME"))(command "-LAYER" "N" "LAYERNAME" ""))

 

 

Message 4 of 7
perkins76
in reply to: Anonymous

jclaidler, I could do the check, but if someone has gone in and changed any of the layers properties, I want this to re-write any of their changes. This does this for every property except the Description. This is probably why every example of a layer lisp I have found does not include the description information...
Message 5 of 7
pendean
in reply to: perkins76

The "make" option in the commandline -LAYER command may be what you need: usage explained in HELP.
Message 6 of 7
perkins76
in reply to: perkins76

I am not having any issue making the layer. My issue is being able to bypass the prompt asking me if I want to change the description when I run it a second time. The default is "NO" so I need to be able to either suppress the question or default the answer to "YES." Here is what I have written... (command "layer" "m" "A-COLS" "c" "yellow" "" "l" "Continuous" "" "d" "Columns" "A-COLS" "" "" "")
Message 7 of 7
pendean
in reply to: perkins76

If checking for the layer as stated above is not an option, then rewrite your lisp to always be prompted: you know, make it, restart and then only always deal with a no/yes situation.

You're also posting in the wrong forum: go to the customizations forum link, go into the lisp forum and run a search: there are many examples that deal with layer descriptions.

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

Post to forums  

Autodesk Design & Make Report

”Boost