canuck7783 Posted September 4, 2008 Posted September 4, 2008 Is there a way to set up autocad so when i type a command (line, dim, hatch) the layer will automatically change to the right layer for me? Quote
smorales02 Posted September 4, 2008 Posted September 4, 2008 Are your layers called LINE, DIM, HATCH and so forth??? Quote
canuck7783 Posted September 4, 2008 Author Posted September 4, 2008 my layers are called - object - for lines (yellow color) dim - for dimensions (red color) hatch - hatch (grey color) hidden - for hidden lines (green color) leader - for qleader command (white color) right now my problem is when ever i type "L" for line my layer will change to the 0 layer (the autocad default layer). So i always have to match properties to turn the line into an object layer after i am done drawing the line. It is starting to get annoying, so i figured i would ask to see if there is a way to fix this problem. Quote
ReMark Posted September 4, 2008 Posted September 4, 2008 So, let's say you're on the DIM layer and you decide you want to draw a line. You want a macro or LISP routine to recognize that fact and change you over to the LINE layer? Quote
canuck7783 Posted September 4, 2008 Author Posted September 4, 2008 correct. Originally i just wanted to fix the problem so i don't have to match properties all the time. But figured if i am able to fix it from not automatically changing, i should make it faster for me to draw and have the layer change automatically when i type in certain commands. Quote
smorales02 Posted September 4, 2008 Posted September 4, 2008 Just a simple one (defun C:LL () (COMMAND ".LAYER" "S" "[color=black]object[/color]",) (COMMAND "LINE")) Quote
canuck7783 Posted September 4, 2008 Author Posted September 4, 2008 How do i apply that code to make it work? I have never really messed with making my own macros/codes. Quote
smorales02 Posted September 4, 2008 Posted September 4, 2008 Copy and paste the code into notepad and save with the extension .lsp (example: object.lsp) onto your desktop or somewhere. Than in ACAD type in APPLOAD (AP for short) and browse and load the routine. Than type LL in the command line to run it. Quote
canuck7783 Posted September 4, 2008 Author Posted September 4, 2008 awesome, thank you. I just have one little problem now. I got it working but once i close out of the drawing and re-open it the lsp programs no longer are working. Is there a way to have it saved to my autocad so the programs work with every drawing i open. Quote
smorales02 Posted September 4, 2008 Posted September 4, 2008 when you go to appload youll see a little briefcase looking thing at the bottom right corner of the dialog box (called startup suite) add the lisp into that folder and it will load everytime you open acad Quote
ReMark Posted September 5, 2008 Posted September 5, 2008 In the Load/Unload Applications dialog box, go to the list box, find the file, then drag it onto the Startup Suite icon. The file will now be read and loaded for each session of AutoCAD. Quote
ASMI Posted September 5, 2008 Posted September 5, 2008 > canuck7783 Look also this thread http://www.cadtutor.net/forum/showthread.php?t=21263 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.