How To 'Map F Key'

Discussion in 'AutoCAD' started by Jeff Clark, Apr 13, 2004.

  1. Jeff Clark

    Jeff Clark Guest

    Can someone walk me through the steps of redefining one of my F Keys?
    I want it to be a toggle:
    toggle 1 would:
    set layer "X" current
    set dimstyle "X" current
    set text style "X" current
    toggle 2 would:
    set layer "Y" current
    set dimstyle "Y" current
    set text style "Y" current

    IS THIS POSSIBLE??

    thanks....
    --
    Jeffrey A. Clark
    Designer III
    Consulting Engineer Services
    856/228-2200
     
    Jeff Clark, Apr 13, 2004
    #1
  2. Jeff Clark

    OLD-CADaver Guest

    these are defined in the ***ACCELERATORS section of your menu. Search through "Developer Help" for a description of editing this section of your menu. The functions you're asking for may need some lisping to accomplish.
     
    OLD-CADaver, Apr 13, 2004
    #2
  3. Jeff Clark

    Paul Turvill Guest

    Your best bet would be to use a macro or a small LISP routine, such as the
    following:

    (defun C:TOGGLE ( )
    (if (/= (getvar "clayer") "x")
    (progn
    (setvar "clayer" "x")
    (command "._dimstyle" "_r" "x")
    (setvar "textstyle" "x")
    ); progn
    (progn
    (setvar "clayer" "y")
    (command "._dimstyle" "_r" "y")
    (setvar "textstyle" "y")
    ); progn
    ); if
    (princ)
    )

    Put the code in a .lsp file; load it in your startup routine, then assign
    the command TOGGLE to an fn key in the ***ACCELERATORS section of your menu,
    as outlined in the HELP system. Beware: if layers, dimstyles, and text
    styles "x" and "y" don't already exist, you'll get errors; to bulletproof
    the code, you'd have to check for their existence and create them if needed.
    ___
     
    Paul Turvill, Apr 13, 2004
    #3
  4. Jeff Clark

    Rudy Tovar Guest

    Edit the acad.mnu and add the following under the heading below at the
    bottom of the page

    ***ACCELERATORS
    //Redefine F1 to do the following - cancel cancel quiet prompt run function
    //Example below
    //================================================//
    ["F1"]^c^c^p(your_function)

    //Call command example below
    //===================//
    ["F1"]^c^c^p_Commandname

    --

    AUTODESK
    Authorized Developer
    www.Cadentity.com
    MASi
     
    Rudy Tovar, Apr 13, 2004
    #4
  5. Jeff Clark

    Jeff Clark Guest

    This is Good!!
    Thanks fellas, I'll try to put that together tomorrow and let you know how
    it works out.....
    -JC
     
    Jeff Clark, Apr 13, 2004
    #5
  6. Jeff Clark

    Jeff Clark Guest

    OK, I have the lisp, and it functions perfectly. The layers, etc. are set up
    in my templates so the chance of an error related to them not being there is
    slim, but I don't think it would be a fatal error anyway.

    Now, we use SurvCADD, which uses it's own menus.
    I think, but am not sure, I would have to modify SurvCADD's base menu.
    Correct?
    When I run the 'menu' command, ACAD is looking for a MNC or MNS file.
    After I modify the MNU, what is the procedure for creating the MNC and/or
    MNS?

    Thanks
    -JC
     
    Jeff Clark, Apr 14, 2004
    #6
  7. Jeff Clark

    Rudy Tovar Guest

    If you're using a custom menu for an application other than Autocads main
    menu, you would modify that menu for all the suggestion we gave you.

    As for an MNS, this only applies if you have an MNS file thats being loaded
    separate, or you would like to define your own custom menus.

    Last, an MNC is a compiled MNU or MNS, that Autocad generates to load along
    with a MNR menu resorce. You load the menu and AutoCAD does the rest.
     
    Rudy Tovar, Apr 14, 2004
    #7
  8. Jeff Clark

    OLD-CADaver Guest

    The MNS and MNC are created when you compile a MNU. After that if you edit toolbars and such graphically, the changes are written back to the MNS, not the MNU.

    I'd create a separate MINI-menu for my custom stuff (including a MNL) to MENULOAD behind the SurvCADD stuff.
     
    OLD-CADaver, Apr 14, 2004
    #8
  9. Jeff Clark

    Jeff Clark Guest

    Well....I don't want to do that!! I have a LOT of customization.
    So I created an icon........
    Isn't there a way to modify the menus without loosing all of my past
    customization??


    edit toolbars and such graphically, the changes are written back to the MNS,
    not the MNU.
    MENULOAD behind the SurvCADD stuff.
     
    Jeff Clark, Apr 14, 2004
    #9
  10. Jeff Clark

    OLD-CADaver Guest

    Don't make changes to the mnu after you've done any graphical customization. Any customization should have been saved in the MNS. So edit the MNS for any new customization.

    The menu should recompile automatically, creating a new MNC and MNR next time you open a file that requires that menu.

    One of the reasons we use a separate menu, and menuload it is that we don't have to retrieve the customization every time we upgrade some piece of the software. We just use the OOTB acad.mnc and menuload our custom stuff behind it.
     
    OLD-CADaver, Apr 14, 2004
    #10
  11. Jeff Clark

    JRodriguez Guest

    i would like to change the default settings of the way the F Keys work. I have set up the left F Keys (F1-F5) to be the OSNAPS that I want. But now i want to set the right side (F6-F12) to be the AutoCad ones. For example; I would like to set F12 to be OSNAP. & Maybe like F9 to be coords instead of F6, or something like that. I dont understand how to get the code to toggle between OSNAP ON & OFF like the original F3 keys does, or any of the toggles that the standard F keys do. Any help in the matter would be greatly appreciated.

    -JRodriguez
     
    JRodriguez, May 19, 2004
    #11
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.