Jump to content

command hot keys


alkorm77

Recommended Posts

is that a reply to me? if so I would love if you could be more specific because im still a newbie at this, lol. I dont know where my acaddoc.Isp is, what it is, or what to do with it.

At the command line enter (findfile "acaddoc.lsp")

If the file is found, open the file with Notepad and enter the above code and save.

If it returns nil, start a new file with Notepad, enter the above code, and save as acaddoc.lsp in the support folder of Autocad.

 

After you start acad, entering w enter will set the Wall layer current. Copy the code and edit for each layer you want.

 

If you also want to set the osnap settings and layer you can do something similar to this

 

[color=Black](defun c:w ()
(setvar "clayer" "wall")
(setvar "osmode" (+ 16384 [color=Red]3[/color]))
)[/color][color=Magenta][color=Black]
[/color][/color]

 

The osnap setting is determined by the red 3 in the code. Edit it to your desired osnap settings, it should be the sum of bitcodes shown below. e.g. Mid+Endpoint = 3 Center+Mid = 6

 

0 NONe

1 ENDpoint

2 MIDpoint

4 CENter

8 NODe

16 QUAdrant

32 INTersection

64 INSertion

128 PERpendicular

256 TANgent

512 NEArest

1024 QUIck

2048 APParent Intersection

4096 EXTension

8192 PARallel

Link to comment
Share on other sites

  • Replies 44
  • Created
  • Last Reply

Top Posters In This Topic

  • TimZilla

    10

  • dbroada

    6

  • Cad64

    5

  • alkorm77

    4

At work I use Auto Cad 2007. no LT, sorry ill go change that now.
In that case you can create your own toolbar and put your own layer settings on each button. I can't help you as I'm at home and don't trust my memory. Have a look in the FAQ to see if there is a "create a toolbar" section or look for similar threads.

 

lpseifert was demonstrating how to add a command into AutoCAD by modifying one of LISP routines that is loaded every time you start AutoCAD. Another trick worth investigating.

Link to comment
Share on other sites

I just noticed you are running LT so the above won't work...

 

yes, just changed that in my profile. I do use regular AutoCad, the full version. At work i was supposed to be trained on this stuff but im having to learn as I produce jobs. Although I'm a rookie I'm still bringing jobs in under hours. The other three guys I work with are trainee's as well and I like to take extra steps to stay above of them. Finding out ways to do stuff like you speak about would make me the top dawgy when it comes to raise time!

Link to comment
Share on other sites

At the command line enter (findfile "acaddoc.lsp")

If the file is found, open the file with Notepad and enter the above code and save.

If it returns nil, start a new file with Notepad, enter the above code, and save as acaddoc.lsp in the support folder of Autocad.

 

After you start acad, entering w enter will set the Wall layer current. Copy the code and edit for each layer you want.

 

If you also want to set the osnap settings and layer you can do something similar to this

 

[color=black](defun c:w ()[/color]
[color=black](setvar "clayer" "wall")[/color]
[color=black](setvar "osmode" (+ 16384 [color=red]3[/color]))
)[/color][color=magenta]
[/color]

 

The osnap setting is determined by the red 3 in the code. Edit it to your desired osnap settings, it should be the sum of bitcodes shown below. e.g. Mid+Endpoint = 3 Center+Mid = 6

 

 

First, I would like to say Thank you very much. It worked very well. So cool being able type w+enter and be in my walls layer just like that. One thing I am having trouble with though is...

 

they way you have the code works by turning the correct snaps although osnaps is off. how to I get it to where the osnaps is already on when I turn my layer on.

 

also, as I said i have a bunch of buttons on my toolbars that turn certain layers on when you click them. Its HydraCAD. those come with preset osnaps and ortho on and polar off. Would you happen to know how to edit those?

 

this is very cool man and I thank all of you guys who help very much.

Link to comment
Share on other sites

another quick one.

 

(defun c:w ()

(setvar "clayer" "wall")

(setvar "osmode" (+ 16384 3))

)

this "clayer" iswhat i type in to make a hotkey for a layer right?

what do i type in if i want to make a certain command a hot key?

would it be "ccommand" ? would it be in the same format and under the same notepad acaddoc?

(defun c:t ()

(setvar "ccommand" "trim")

would that work?

Link to comment
Share on other sites

There is already a command alias for the Trim command. It's TR. Check your acad.pgp file for a list of all the command keyboard shortcuts. Tools Menu > Customize > Edit Program Parameters(acad.pgp)

Link to comment
Share on other sites

as Cad has said, look at your PGP file, most of the AutoCAD commands have a "shortcut" already defined there. If you have express tools installed there is a section for something like "command alias editor" - check that out.

 

What lpsiefert has shown is how to create a brand new command, in this case called W. All it does is change a number of system variables. In this case Current LAYER and the snap setting. You can use this method to create other commands or modify existing ones but you need to be certain of what you are doing as it is possible to disable (for example) the save command with nasty consequences.

Link to comment
Share on other sites

 

they way you have the code works by turning the correct snaps although osnaps is off. how to I get it to where the osnaps is already on when I turn my layer on.

(defun c:w ()
(setvar "clayer" "walls")
(setvar "osmode" [color=Magenta]3[color=Black])
)
[/color][/color]

Let me break it down for you...

(defun c:w () Define a new command named w

(setvar "clayer" "walls") Set the variable clayer [current layer] to Walls

(setvar "osmode" 3) Set the variable osmode [osnap mode] to 3

) End of function definition

 

(defun c:t ()

(setvar "ccommand" "trim")

would that work?

Nope. As Cad64 pointed out there is an alias (shortcut) already defined for trim in your acad.pgp file (and a whole lot more), and that is the best way to make an alias for a single command.

That being said, here is an alternative method per your question

(defun c:t ()
(command "trim")
)

This method works if you want to add an option to the command, e.g. Zoom > Extents

(defun c:ze ()
(command "zoom" "e")
)
Link to comment
Share on other sites

My layer Isolate is different on 08 than 07. On 07 it isolates the layer I pick by turning all the other layers off. On 08 it isolates the layer I pick by locking every other layer. I know this might be a better way for most. I use it for pipe sizing, if i have to make a change .I isolate just the pipe sizes, highlight all of them, hit properties and change them all at once. Using 08 with the lock feature it wont let me do that. Is there any way I can change it to where it turns it off instead of locking it?

Link to comment
Share on other sites

I believe CarlB already gave you the answer to this question in your other thread? :?

http://www.cadtutor.net/forum/showthread.php?t=21048

 

Initiate the LAYISO command, then type S for Settings. This will allow you to specify whether you want the other layers to be locked and faded or just turned off like in previous versions. Watch your command line.

Link to comment
Share on other sites

I believe CarlB already gave you the answer to this question in your other thread? :?

http://www.cadtutor.net/forum/showthread.php?t=21048

 

Initiate the LAYISO command, then type S for Settings. This will allow you to specify whether you want the other layers to be locked and faded or just turned off like in previous versions. Watch your command line.

 

yeah i know but I'm new to this and and I only know how to do enough to get my job at work done. I am tired of doing stuff the long way so I'm seeking help. That being said Carl B's instructions were not detailed enough, lol. I need to add a signature to my name that says "When giving me instructions be very detailed. Start with " now move your mouse to the left and click that thing that looks like......."

 

Your answer is a lot better man. Thanks.

 

You'll be sick of answering my questions after a week or two because I have a million more. One at a time though.

Link to comment
Share on other sites

You'll be sick of answering my questions after a week or two because I have a million more. One at a time though.

 

No worries, ask away. :) Just take it one step at a time.

Before you know it, you'll be answering other people's questions. :wink:

Link to comment
Share on other sites

No worries, ask away. :) Just take it one step at a time.

Before you know it, you'll be answering other people's questions. :wink:

 

I work with Fire Sprinklers using a program called HydraCAD. There is a plot style we have called Hydragrey. Which basically prints certain things darker than other based on the layer ( not color )

 

I want to make it to where it prints my walls a little bit darker. Ive tried changing the color and that's when i figured it was set up by layer. Any advice on a way to edit this?

 

Ive looked all around and couldn't figure it out. :x

Link to comment
Share on other sites

  • 1 year later...
I work with Fire Sprinklers using a program called HydraCAD. There is a plot style we have called Hydragrey. Which basically prints certain things darker than other based on the layer ( not color )

 

I want to make it to where it prints my walls a little bit darker. Ive tried changing the color and that's when i figured it was set up by layer. Any advice on a way to edit this?

 

Ive looked all around and couldn't figure it out. :x

 

 

You should learn AutoSPRINK. :wink:

Link to comment
Share on other sites

There is already a command alias for the Trim command. It's TR. Check your acad.pgp file for a list of all the command keyboard shortcuts. Tools Menu > Customize > Edit Program Parameters(acad.pgp)

 

I opened my acad.pgp file, change my *CIRCLE command to "CI" and *COPY to "C". I also changed *DIMSTYLE to "DI" and *DISTANCE to "D".

 

I saved, closed both the .pgp file and the program, opened the program back up and...back to the original settings even though the .pgp file still has the changes I made.

 

What am I doing wrong?

Link to comment
Share on other sites

I opened my acad.pgp file, change my *CIRCLE command to "CI" and *COPY to "C". I also changed *DIMSTYLE to "DI" and *DISTANCE to "D".

 

I saved, closed both the .pgp file and the program, opened the program back up and...back to the original settings even though the .pgp file still has the changes I made.

 

What am I doing wrong?

 

Did you get to the acad.pgp using menus? Tools>Customize>Edit Program Parameters (acad.pgp)

 

You must have more than one acad.pgp on your computer and the one you edited must not be in the search path or is called in the search path before the other one. Either way getting to the file as shown above will fix that.

Link to comment
Share on other sites

I realise the command line is very powerful, and sometimes it is very useful. I'm asking if you can fully customise your keyboard for any command. So if ltscale was something you used regularly, why not make it 'alt + l' or something along those lines. What i'm suggesting can cut seconds out of each command, especially for 3D modelling. I used to use Solidworks at my previous work and along with another designer we had our Cad systems so customised for 95% of the tools we used, and was left with only one tool bar on the screen. OK, it took a couple of months to learn and there was an A3 spreadsheet stuck to my office wall with the hot keys defined for each command, but after that couple of months, in an office of 10 designers, we were modelling and producing drawings 40% faster than the other 8. Now that is productivity. So my question still stands, can you customise commands with hot keys?

 

AutoCAD can be customized numerous ways to do what you seek. For the Hot Keys use the CUI file. Type CUI at the command line and customize there (see help file). For other key definitions requiring an enter,space bar, right click, edit the ACAD.PGP, and or create an acaddoc.lsp file. Finally a toolbar with your most frequent commands can be made easily enough. Also, buy a multi button mouse and customize those as well.

Link to comment
Share on other sites

Did you get to the acad.pgp using menus? Tools>Customize>Edit Program Parameters (acad.pgp)

 

You must have more than one acad.pgp on your computer and the one you edited must not be in the search path or is called in the search path before the other one. Either way getting to the file as shown above will fix that.

 

 

Okay, I figured out what the problem is. The .pgp that I had originally edited is in my local AutoCAD 09 program file (which I had accessed externally). When I go through the program to access the .pgp file, it calls one that is set by my office's system administrator and I have 'read-only' access to it.

 

Is there a way to bypass or supercede the stupid generic .pgp file? I can't find a place to alter the pathname of the .pgp file that my program references. I'm sure someone knows how to do this, though.

Link to comment
Share on other sites

Is there a way to bypass or supercede the stupid generic .pgp file? I can't find a place to alter the pathname of the .pgp file that my program references. I'm sure someone knows how to do this, though.

 

I stopped editing the pgp file years ago and just use three custom lisp files for all my settings. I have the acaddoc.lsp and that has lots of autoload calls to lots of lisp files I use, it also loads a Personal_Qkeys.lsp file that duplicates what others might have in the pgp, then I have a Personal_Settings.lsp file that sets the various setvars I want to always be set to a certain value. This could be in one file but I like the separation.

 

You can go into the Options, Files, support file search path and make sure your path to your pgp is in there, then move it to the top (I think that is right, experiment having it at the top and at the bottom, I can't remember which order files are loaded).

Link to comment
Share on other sites

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