PDA

View Full Version : Command combinations



Kate M
26th Sep 2003, 07:11 pm
I've probably got the terminology totally wrong, but I'd like to make AutoCAD recognize combinations of commands at the command line. Like "ze" for zoom extents. I know you can't do this in the pgp file, it doesn't need to go on a button or menu...hoping it's not a lisp 'cause I have LT. :-) Macros, maybe? I'm totally new at programming/customization, so any help would be greatly appreciated. :-)

Thanks!

-Kate

SpeedCAD
26th Sep 2003, 07:42 pm
HI...

Example:


(defun c:ze ()
(command "_.zoom" "_e")
)

(defun c:zp ()
(command "_.zoom" "_p")
)

etc... but if you have AutoCAD LT you can't load the rutine lisp... :roll:

hyposmurf
26th Sep 2003, 07:46 pm
Your talking about the command alias editor.Your PGP file does contain those shortcuts that have been set as default by AutoCAD but you can modify them with this tool.Make sure youve made a copy of the PGP file so that you have an unaltered version should you change your mind.You didnt state which version of AutoCAD youre using which is a coman mistake of mine to! :) This is how to for CAD2004

http://www.caddigest.com/subjects/autocad/tutorials/select/parsai_command_alias_editor.htm

Kate M
26th Sep 2003, 08:58 pm
I already know about modifying the shortcuts (running 2000i LT, no express tools, so I just open up the PGP and make my changes). What you can't do there is set the shortcut "ze" to execute both "zoom" and "extents", unless I'm mistaken. I seem to remember somebody calling these "hot keys"...but that was a while ago...

CADTutor
26th Sep 2003, 09:37 pm
Yes, the PGP file can only be used to create shortcuts that invoke a command but don't allow command line options. However, since the shortcut for Zoom is "Z", you can type "Z<return>E" for zoom extents. Admittedly that is three keystrokes rather than two but the only way to do what you want is to use LISP - sorry :cry:

Flores
26th Sep 2003, 10:02 pm
Can you customize buttons in LT? If you can, here is a little macro that will work:

^C^Czoom;e

Flores

Kate M
29th Sep 2003, 09:43 pm
Thanks, guys -- I do use the "Z<enter>E" to zoom extents, but I end up typing "ZE<enter>" often enough that I wanted a way to tell AutoCAD what I really mean. :-) I'll keep that lisp routine in mind for when we upgrade to the full version, though... :wink:

hyposmurf
30th Sep 2003, 01:23 pm
Can you make that macro in the LT version?If not maybe you set your hotkey(accelertor keys) to one of the function keys,that way youll only require two key strokes :) .You'll find them at the bottom of the MNU and MNS file.Its not generally a good idea to change these keys as they are used for such things as help and the OSNAP command,but it depends how desperate you are to have one key stroke less for your zoom extents command.You could always use the insert or arrow keys.

Kate M
2nd Oct 2003, 03:43 pm
I think we can use macros in LT, but I'm not very familiar with them at all. I've read about the syntax, but I'm not quite sure how to use them -- are macros always associated with buttons? or can you invoke them from the command line? Thanks for all your help. :-)

-Kate