Jump to content

Need help creating a command I can type


Recommended Posts

Posted

I'm running autocad 2011. I've gotten used to the ribbon but I like typing in commands. One that I wanted to be able to type is "unlock all" without going into my layer manager.

Posted

add this to your acad.pgp file

(defun c:UnlockAll () (command "-layer" "u" "*" ""))

Posted
One that I wanted to be able to type is "unlock all" without going into my layer manager.

 

The secret is to type "-la". The "-" stops the layer manager dialogue screen from opening up.

 

So your command should go like this:

-la (enter)

u (enter)

* (enter)

(enter)

 

which is probably quicker than typing "UnlockAll" :D

Posted
The secret is to type "-la". The "-" stops the layer manager dialogue screen from opening up.

 

So your command should go like this:

-la (enter)

u (enter)

* (enter)

(enter)

 

which is probably quicker than typing "UnlockAll" :D

 

Then do it like this:

 

add this to your acad.pgp file

(defun c:[b]UA[/b] () (command "-layer" "u" "*" ""))

 

Ofcourse, I would choose LU instead since L and U are close together...

 

:D :D

Posted

where in my pgp would i add it? just make a new line and put it anywhere? Or does it need ot be in a specific place?.....The -LA command is a way to do it but its too many keys to type..I wanted to run the command by just typing a letter or 2..

Posted

For what it is worth, the - before the layer command isn't needed in the lisp routine, try it without the -, I just did and it still works, IE: no dialog pops up.

Posted
Will this work on LT?

Macro it:

^C^C-layer;unlock;*;;

 

I'm not a button/macro user, but that should work.

Posted

Must harass my Manager about letting me have that license of full AutoCAD that no-one is using anymore!

Posted
Must harass my Manager about letting me have that license of full AutoCAD that no-one is using anymore!

MMM, LISP capabilities.

Posted

ok..The macro didnt work. Unless i did something wrong..But i think i created it right....I'm fairly to this. But figured I could handle this : ( Any other help you guys could give me would be greatly appreciated...

Posted
ok..The macro didnt work. Unless i did something wrong..But i think i created it right....I'm fairly to this. But figured I could handle this : ( Any other help you guys could give me would be greatly appreciated...

Try it this way (remove quotes, but keep all spaces).

"^C^C-layer unlock * "

Posted

Nope. Could it have to do with the * symbol? DOesnt that mean something else when writing a macro? Bear in mind i'm just learning about macros if I sound like I dont know what i'm talking about. : )

Posted (edited)

When I create macro's or scripts I always test it in the command line first and write all the keypresses down to make sure it works. In this case

-layer, see what happens, AutoCAD will generally prompt you for what commands to type next in the command line, then try the next bit

unlock, then try the * or whatever AutoCAD prompts you.

 

Remember that the letter written in capitals at the prompt is the shortcut letter, although when the option is on and off they will both be all in captials.

Edited by Glen1980
Forgot a few words ;)
Posted

Try this for your macro instead.

 

^C^C_-LAYER;_UNL;*;

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...