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!
![]() |
|
![]() |
|
![]() |
|
![]() |
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.![]()
"How we think determines what we do, and what we do determines what we get."
Sincpac C3D ~ Autodesk Exchange Apps
Computer Specs:
Dell Precision 3660, Core i9-12900K 5.2GHz, 64GB DDR5 RAM, PCIe 4.0 M.2 SSD (RAID 0), 16GB NVIDIA RTX A4000
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
"How we think determines what we do, and what we do determines what we get."
Sincpac C3D ~ Autodesk Exchange Apps
Computer Specs:
Dell Precision 3660, Core i9-12900K 5.2GHz, 64GB DDR5 RAM, PCIe 4.0 M.2 SSD (RAID 0), 16GB NVIDIA RTX A4000
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!!
"How we think determines what we do, and what we do determines what we get."
Sincpac C3D ~ Autodesk Exchange Apps
Computer Specs:
Dell Precision 3660, Core i9-12900K 5.2GHz, 64GB DDR5 RAM, PCIe 4.0 M.2 SSD (RAID 0), 16GB NVIDIA RTX A4000