Jump to content

question about combining layers and commands


Recommended Posts

Posted

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?

Posted

Are your layers called LINE, DIM, HATCH and so forth???

Posted

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.

Posted

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?

Posted

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.

Posted

Just a simple one

 

(defun C:LL ()
(COMMAND ".LAYER" "S" "[color=black]object[/color]",)
(COMMAND "LINE"))

Posted

How do i apply that code to make it work?

 

I have never really messed with making my own macros/codes.

Posted

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.

Posted

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.

Posted

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

Posted

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.

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...