Does anyone know if there's an easy way to create aliases for more than one command. For example, I want to create an alias 'ZA' that will ZOOM then ALL. The PGP file only allows one command aliases. Can this only be done in LISP and if so, does anyone have some sample code?
Any help appreciated.
Didn't find your answer? Ask the community — no account required.
M
Michael Bulatovich
LISP will do that:
(defun c:za (/)(command "zoom" "a"))
Of course, you have to load it first.
C
Chip Harper
This is autoloaded on startup ... email me for a zipped copy if desired...
;; *********************************************************************** ;; ** ;; * ZOOMCUT.lsp written by Chip Harper 08-07-02 * ;; * Edited to add ZL command on 08-26-02 * ;; * Edited to turn off cmdecho on 03-25-03 * ;; * Edited ZL point variable names on 03-25-03 * ;; * Edited CCME to match standards on 05-11-03 * ;; ** ;; * Email: snipped-for-privacy@hotmail.com * ;; ** ;; * Homepage: * ;; ** ;; * Program establishes 2 letter shortcuts for zoom commands * ;; * zoom extents = ZE * ;; * zoom window = ZW * ;; * zoom previous = ZP * ;; * zoom all = ZA * ;; * zoom center = ZC * ;; * zoom dynamic = ZD * ;; * zoom scale = ZS * ;; * zoom limits = ZL * ;; ** ;; * Notes: Zoom Limits is not a "Native" command; Basicly it is a zoom * ;; * window using drawing limits as pick points. Limits need to * ;; * be set prior to using the command, as it will not prompt for * ;; * points. * ;; ** ;; * Because of the simple nature of the programs * ;; * no Error Handler is needed or provided. * ;; ** ;; * This program is "Autoloaded" with AutoCAD on my machine * ;; * via the profile.mnl file located in the custom directory. * ;; ** ;; ** ;; * This lisp is FREEWARE, you may distribute, copy, edit and/or modify * ;; * this program as you see fit. * ;; ** ;; *********************************************************************** ;; ;; **************************************** ;; * == Error Handler == * ;; * * ;; **************************************** ;; ;; none ;; ;; ;; **************************************** ;; * == Main Function == * ;; * * ;; **************************************** ;; (defun C:ZE () ; Zoom Extents (setq CCME (getvar "cmdecho")) ; Get cmdecho setting (setvar "cmdecho" 0) ; Turn off cmdecho (command "_.ZOOM" "_E") (setvar "cmdecho" CCME) ; Reset cmdecho (princ) ) ; End C:ZE.
I have another option that uses an accelerators all that is needed is that in an MNS file that is loaded add the following
***ACCELERATORS [CONTROL+"F1"] 'zoom Dynamic [CONTROL+"F2"] 'zoom window [CONTROL+"F3"] 'zoom all
What This does is with the Control key held down then press the F1 and the zoom dynamic is started.
Only 2 keys are pressed not 3( Z E Enter) Think of it, If you use the zoom window alot, lets say 100 times a day or more that is 100+ less key strokes to be made, and like the ZE Control and F1-F5 all reachable with just the right hand.
I have also set up accelerators for all the OSnaps using the Shift and a FunctionKey
Half my office work group uses these.
B
B. W. Salt.
In article , snipped-for-privacy@nominous.com (Disco Dave) wrote:
Here is a whole series of simple aliases. Put them in your Acad Support directory and then add them to the acad.lsp start-up file. They will then always be loaded.
This one is called "Jkeys".
(princ "\n ...Loading Jkeys!...\n")
;Sub-routines used in Jkeys (Defun Eon () (setvar "cmdecho" 1) );Eon
and this is the "ref" code for doing anything with reference to some other entity:
; REF.LSP
; This is a useful routine for obtaining a relative point. ; It can be used whenever an AutoCAD command requests a point. ; Just enter "(ref)" in response to the "...point:" prompt, and ; enter the desired base (reference) point and the relative/polar ; offset from that point. For example:
; Command: LINE ; From point: (ref) ; Reference point: (...pick a point...) ; Enter relative/polar coordinate (with @): @x,y or @dist
Join the Discussion
Have something to add? Share your thoughts — no account required.
Didn't find your answer?
Ask the community — no account required
Report Content
You are reporting this content to the moderators. They will look at it
ASAP.