How do I create a typed short form command for a group of associated commands? For example, I would like to type ZD for Zoom Dynamic, instead of Z enter D. Also ZW for Zoom Window, instead of Z enter W, ZE for Zoom Extents, etc. Thanks!
Printable View
How do I create a typed short form command for a group of associated commands? For example, I would like to type ZD for Zoom Dynamic, instead of Z enter D. Also ZW for Zoom Window, instead of Z enter W, ZE for Zoom Extents, etc. Thanks!
Welcome to AUGI. :)
Code:(defun c:ZD () (command "._zoom" "dynamic") (princ))
(defun c:ZW () (command "._zoom" "window") (princ))
(defun c:ZE () (command "._zoom" "extents") (princ))
** Moderator - Please move this thread to the LISP forum. :beer:
Thanks!! I tried typing this in the command line, and it worked, but only in the drawing I had open. If I close the drawing and open a new one, the command doesn't work anymore. Also, if I close out of Autocad and reopen, the new command disappears. Is there something else I need to do to make the command change permanent? Thanks for your help!
Unfortunately, AutoLISP and Visual LISP code only exist within the document in which it (the source-code) is loaded.
For your new additions to be included automagically in each document you open, you'll need to incorporate a LOAD, or an AUTOLOAD statement for each LISP file (.lsp) you want to be made available, within your AcadDoc.lsp file.
HTH
I eventually figured how to put the code into an autolisp file and set it to automatically load whenever I openAutocad. I am just inputting different command groups based on the code you sent me, and it seems to be working every time. Thank you very much!!