Nope, the shortcuts the .pgp file can only *launch* commands; they can't
pass on any parameters or subcommands (like "ALL"). To create a shortcut
like the one you want, you'll have to resort to something like a LISP
(defun C:ZA ( )
(command "zoom" "all")
But it can be done. you can assign keyboard shortcuts for the various
zooms. I know because I did it. Go to tools, customize keyboard, and
zoom all is one of the items in the view menu that can be assigned.
Read this carefully before beginning:
Type the following to open ACAD.MNS:
(startapp "notepad" (findfile "acad.mns"))
Type Ctrl+F to search for "Accelerators".
These are the accelerator keys. They are associated with an ID. So,
if there is a command in the menu that assigns the ID, the accelerator
should find it and perform the macro behind it. Notice that directly
above the Accelerators is the Screen menu for the ZOOM commands. Very
convenient. I have AutoCAD 2006, and am on CUI now, but I saved an
ACAD.MNS to refer to for things like this. I think that you can
create a new line with a macro in it like this: [ZE]'_zoom;_e; and
insert an ID in front of it:
Now I'm thinking you have a command and ID associated. I can't test
this out, but I believe that if your ACCELERATORS refers to the ID_ZE,
it will call up the macro.
So you can write a line under "Accelerators" that looks like this:
I think that doing this will cause the Zoom Extents to happen if you
press the ALT and F9 keys simultaneously.
When you're done in ACAD.MNS, type the following, but remember that
you might have to run EXPRESSMENU if you have EXPRESS TOOLS installed
and you if you have other menus loaded, you'll have to reload them
(command "_.menu" "acad.mns")
If ACAD.MNS works right, at that point, save it as ACAD.MNU. If it
fails, and you get frustrated, then hopefully you haven't changed
ACAD.MNU, so you can load ACAD.MNU:
(command "_.menu" "acad.mnu"). At that point ACAD.MNS will be
overwritten to match ACAD.MNU.
Remember: Do NOT touch ACAD.MNU until everything working correctly.
Work with ACAD.MNS. When you load ACAD.MNS, it won't overwrite
ACAD.MNU. But when you load ACAD.MNU, it overwrites ACAD.MNS.
Therefore ACAD.MNU is your backup in case ACAD.MNS gets messed up.
Make sure you have tested your changes to ACAD.MNS thoroughly before
saving as ACAD.MNU.
Let us know how it goes
Polytechforum.com is a website by engineers for engineers. It is not affiliated with any of manufacturers or vendors discussed here.
All logos and trade names are the property of their respective owners.