See the top rated post in this thread. Click here

Page 1 of 3 123 LastLast
Results 1 to 10 of 30

Thread: Edit Command Aliases and add new ones

  1. #1
    Member
    Join Date
    2016-01
    Posts
    11
    Login to Give a bone
    0

    Default Edit Command Aliases and add new ones

    This is my first post on AUGI. I am trying to create new command aliases: “c” for copy (instead of circle), “zw” for zoom window, and more. The instructions start by saying “Click Tools” and I’m already stymied. There is no “Tools” to click that I can see. Can anyone help on how to view a list command aliases and how to either modify or add new ones? Thanks much.

  2. #2
    Certifiable AUGI Addict tedg's Avatar
    Join Date
    2005-06
    Location
    in the upper right corner
    Posts
    3,508
    Login to Give a bone
    0

    Default Re: Edit Command Aliases and add new ones

    Quote Originally Posted by LGDzign718439 View Post
    This is my first post on AUGI. I am trying to create new command aliases: “c” for copy (instead of circle), “zw” for zoom window, and more. The instructions start by saying “Click Tools” and I’m already stymied. There is no “Tools” to click that I can see. Can anyone help on how to view a list command aliases and how to either modify or add new ones? Thanks much.
    Congrats on your first post.

    There is an "alias editor" which does what you're trying to do, but basically it edits the acad.pgp file which is the actual file that contains the OOTB alias' as well as your custom ones.

  3. #3
    Certifiable AUGI Addict tedg's Avatar
    Join Date
    2005-06
    Location
    in the upper right corner
    Posts
    3,508
    Login to Give a bone
    0

    Default Re: Edit Command Aliases and add new ones

    I'm not sure about AutoCAD 2011 (referenced in this thread) but I believe if you have Express Tools, go to "Express Tools>Tools>Command Alias Editor"
    Or on the command line "aliasedit"

  4. #4
    Administrator Opie's Avatar
    Join Date
    2002-01
    Location
    jUSt Here (a lot)
    Posts
    9,106
    Login to Give a bone
    1

    Default Re: Edit Command Aliases and add new ones

    The "C" for copy alias is doable, but the "ZW" for zoom, window, is not a valid command alias. Command aliases can start the command but cannot use any of the options of the command. Zoom is a command and Window is an option of the zoom command.
    If you have a technical question, please find the appropriate forum and ask it there.
    You will get a quicker response from your fellow AUGI members than if you sent it to me via a PM or email.
    jUSt

  5. #5
    Certifiable AUGI Addict tedg's Avatar
    Join Date
    2005-06
    Location
    in the upper right corner
    Posts
    3,508
    Login to Give a bone
    0

    Default Re: Edit Command Aliases and add new ones

    Quote Originally Posted by Opie View Post
    The "C" for copy alias is doable, but the "ZW" for zoom, window, is not a valid command alias. Command aliases can start the command but cannot use any of the options of the command. Zoom is a command and Window is an option of the zoom command.
    Good point Opie... I actually didn't read that far.
    One would need a lisp or custom tool bar for something like that.

    I have a quick routine I've had FOREVER to zoom 90% of the extents:

    Code:
    ;;zooms view .9x of extents
    (defun c:zx () (command "zoom"  "e"  "zoom"  ".9x" ) (princ)
    )

  6. #6
    Administrator rkmcswain's Avatar
    Join Date
    2004-09
    Location
    Earth
    Posts
    9,805
    Login to Give a bone
    1

    Default Re: Edit Command Aliases and add new ones

    As @tedg and @opie pointed out, you can't do everything with Command Aliases.

    For things such as ZW (for Zoom Window), you'll need to use some autolisp.

    @tedg gave you a good example.

    So what do you do with this stuff?

    Create a new text file using NOTEPAD.

    Paste in the code that @tedg provided.

    Here are some more examples:

    Code:
    (defun c:fr ()(princ "Macro: Fillet Radius")(vl-cmdf "._fillet" "_r")(princ))
    (defun c:ld ()(princ "Macro: Lengthen Dynamic ")(vl-cmdf "._lengthen" "_dy")(princ))
    (defun c:zv ()(princ "Macro: Zoom Vmax ")(vl-cmdf ".zoom" "_v")(princ))
    (defun c:zw ()(princ "Macro: Zoom Window ")(vl-cmdf ".zoom" "_w")(princ))
    When you are done, save this file with the name "acaddoc.lsp" (put quotes around the name when you are saving -OR- you will get "acaddoc.lsp.txt", which WILL NOT WORK)

    Now create a new folder called C:\CADSTUFF (that is a suggestion, the name is not important).

    Place this new file named "acaddoc.lsp" and put it in that new folder.

    Open AutoCAD, run the OPTIONS command, go to the FILES tab, and add C:\CADSTUFF to the Support File Search Path _and_ move it to the TOP of the list of paths.

    Close AutoCAD and reopen it.

    Your shortcuts should now work..
    R.K. McSwain | CAD Panacea |

  7. #7
    Certified AUGI Addict jaberwok's Avatar
    Join Date
    2000-12
    Location
    0,0,0 The Origin
    Posts
    8,570
    Login to Give a bone
    2

    Default Re: Edit Command Aliases and add new ones

    Quote Originally Posted by rkmcswain View Post
    Create a new text file using NOTEPAD.
    <snip>
    When you are done, save this file with the name "acaddoc.lsp" (put quotes around the name when you are saving OR you will get "acaddoc.lsp.txt", which WILL NOT WORK)
    <snip>
    Or pick *.* from the "Save as type" box - no quotes required.

  8. #8
    Certified AUGI Addict cadtag's Avatar
    Join Date
    2000-12
    Location
    Cairo - no, not Illinois
    Posts
    5,069
    Login to Give a bone
    2

    Default Re: Edit Command Aliases and add new ones

    and just to be finicky -- there's no need to use the "W" to force a Zoom Window command. Unless one chooses a different option Z will always default to Window.

    ZP for zoom previous of course will call for the coding noted above.

  9. #9
    Member
    Join Date
    2016-01
    Posts
    11
    Login to Give a bone
    0

    Default Re: Edit Command Aliases and add new ones

    Thanks Ted. So how do I access the "alias editor".

  10. #10
    Member
    Join Date
    2016-01
    Posts
    11
    Login to Give a bone
    0

    Default Re: Edit Command Aliases and add new ones

    These look great. Thanks for the exact directions. I will try it.
    Last edited by Larry Deigh; 2016-01-19 at 03:51 PM.

Page 1 of 3 123 LastLast

Similar Threads

  1. Command Aliases for Custom Commands
    By mockdeep in forum AutoCAD General
    Replies: 3
    Last Post: 2007-08-02, 01:39 PM
  2. Edit Command Aliases via CUI
    By autocad.wishlist1734 in forum AutoCAD Wish List
    Replies: 2
    Last Post: 2007-07-25, 12:46 PM
  3. Command aliases not working
    By lambertm in forum AutoCAD General
    Replies: 13
    Last Post: 2005-08-02, 02:30 PM
  4. Customize command aliases
    By kyle.86575 in forum AutoCAD Customization
    Replies: 3
    Last Post: 2005-05-06, 01:42 PM
  5. Command Aliases
    By frank.burnham in forum ACA General
    Replies: 2
    Last Post: 2004-10-26, 06:31 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
  •