Results 1 to 6 of 6

Thread: create typed shortcut for command group

  1. #1
    Member
    Join Date
    2012-10
    Posts
    6


    Default create typed shortcut for command group

    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!

  2. #2
    Programming Moderator BlackBox's Avatar
    Join Date
    2009-11
    Posts
    5,195


    Default Re: create typed shortcut for command group

    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.
    "Potential has a shelf life." - Margaret Atwood
    AutoCAD, and Civil 3D Certified Professional | Autodesk Authorized Developer
    Sincpac C3D ~ Autodesk Exchange Apps

  3. #3
    Member
    Join Date
    2012-10
    Posts
    6


    Default Re: create typed shortcut for command group

    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!

  4. #4
    Programming Moderator BlackBox's Avatar
    Join Date
    2009-11
    Posts
    5,195


    Default Re: create typed shortcut for command group

    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
    "Potential has a shelf life." - Margaret Atwood
    AutoCAD, and Civil 3D Certified Professional | Autodesk Authorized Developer
    Sincpac C3D ~ Autodesk Exchange Apps

  5. #5
    Member
    Join Date
    2012-10
    Posts
    6


    Default Re: create typed shortcut for command group

    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!!

  6. #6
    Programming Moderator BlackBox's Avatar
    Join Date
    2009-11
    Posts
    5,195


    Default Re: create typed shortcut for command group

    Quote Originally Posted by archiasmo954906 View Post
    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!!
    You're welcome; I'm happy to help
    "Potential has a shelf life." - Margaret Atwood
    AutoCAD, and Civil 3D Certified Professional | Autodesk Authorized Developer
    Sincpac C3D ~ Autodesk Exchange Apps

Similar Threads

  1. How do I create a single, short, typed command for a linked group of commands?
    By archiasmo954906 in forum AutoCAD Customization
    Replies: 7
    Last Post: 2012-11-16, 06:02 PM
  2. Replies: 0
    Last Post: 2010-09-03, 07:14 AM
  3. Create Windows XP Shortcut
    By BlackBox in forum AutoLISP
    Replies: 14
    Last Post: 2010-08-02, 09:39 AM
  4. Create / Setup shortcut for ALIGN command?
    By Cadtharsis in forum AutoCAD Customization
    Replies: 8
    Last Post: 2007-03-21, 08:11 PM
  5. Create own Shortcut Keys
    By basha_sk312 in forum AutoCAD CUI Menus
    Replies: 2
    Last Post: 2006-03-15, 08:37 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •