s it possible to create shortcuts to change between layers rather than using the pull down menu to select the layer required??
Any assistance on this or creating custom shortcuts would be greatly appreciated.
Solved! Go to Solution.
you can use a little bit of LISP to do that. Look at this lines:
(defun C:L1()(command "_-LAYER" "_M" "MyLayer1" ""))
(defun C:L2()(command "_-LAYER" "_M" "MyLayer2" ""))
(defun C:L3()(command "_-LAYER" "_M" "MyLayer3" ""))
(defun C:L4()(command "_-LAYER" "_M" "MyLayer4" ""))
If you copy these lines at the end of your ACADDOC.LSP you have 4 additional commands (L1 or L2 or L3 or L4 like the green colored letters) that makes layers (layername = orange part) active, and if they don't exist they are created.
So if you start then the command L1 it makes the layer "MyLayer1" active.
You can now copy or modify these lines (they are just samples to let you understand what's happening), create your own commands (each line one command) and give each command a layer you like.
HTH, - alfred -
>> Do I have to use 'L1' as the command?
If you defined the command to be named "L1" then you have to type "L1<ENTER>" to start the command.
If you want a command to be named with just one character you can do that, e.g.;
(defun C:1()(command "_-LAYER" "_M" "MyLayer1" ""))
Now you can start it with 1<ENTER>, but be careful with numbers as command names, it's not that it's forbidden, but I have not a good feeling then. (just a feeling, not more).
- alfred -
Are you concerned using numbers for commands might cause problems with the program/ script?
Also while we are on the topic, can you alter existing shortcut commands for example; co = copy can i modify it to c = copy?
>> Also while we are on the topic, can you alter existing shortcut commands
>> for example; co = copy can i modify it to c = copy?
That shortcuts are defined in the file ACAD.PGP. If you want them to be modified do that modification in this file (or when you have installed the ExpressTools, then you can use command ALIASEDIT to modify the content of this file).
>> Are you concerned using numbers for commands might cause problems with the program/ script?
Yes, anytime and anywhere, and exactly following >>>murphys laws<<<
- alfred -
Sorry Alfred, i'm not familair where the ACAD.PGP. file is located and Im not familiar with Express tools.
I am using a 2011 Lt verison. will Express tools work with this?
Thanks. You 've been very helpful
>> I am using a 2011 Lt verison
Sorry to say now, but for LT all the above tips won't work as LT does not have LISP included. And so also ExpressTools don't exist in LT-version of AutoCAD.
At least the ACAD.PGP does exist and can be modified by using a normal texteditor like Notepad.The position of the file depends on your operating system, the easiest way is to search your local disk for a file named ACAD.PGP, it will find one in your user-directory (for release 2011), that can be modified.
IMPORTANT: before making any modifications ==> backup your file!
- alfred -