Displaying a menu in a menu

Discussion in 'AutoCAD' started by kendresen, Apr 21, 2004.

  1. kendresen

    kendresen Guest

    Here is my problem. I am trying to make a menu for my company. We have three departments which all use there own stuff. But the stuff we share I don't want to copy 3 times into each pull down. I would like to have a general section on top of each pull down and then the tools for each department under that. something like this

    ***POP1
    **General
    [General]
    [BLAH]
    [BLAH]

    **MENU1
    [MENU!]
    (here would display the general stuff)
    [--]
    [Tools]
    [Blocks]
    [Layers]
     
    kendresen, Apr 21, 2004
    #1
  2. Alan Henderson, Apr 21, 2004
    #2
  3. kendresen

    ECCAD Guest

    Something like this might work.

    ;; Menuload.lsp (fragment)
    ;;
    (setq local_drive "C:"); Local or Network Drive Letter + :
    ;;
    (if (findfile (strcat local_drive "/menus/dept1.mns"))
    (progn
    (if (= (menugroup "DEPT1") nil)
    (progn
    (command "_MENULOAD" (strcat local_drive "/menus/dept1"))
    (menucmd "P10=+DEPT1.POP1")
    ); end progn
    ); end if
    ); end progn
    ); end if
    (if (findfile (strcat local_drive "/menus/dept2.mns"))
    (progn
    (if (= (menugroup "DEPT2") nil)
    (progn
    (command "_MENULOAD" (strcat local_drive "/menus/dept2"))
    (menucmd "P10=+DEPT2.POP1")
    ); end progn
    ); end if
    ); end progn
    ); end if
    ;;
    ;; - next menu to check for..
    (princ)

    ---------------------
    Menus:
    Dept1.mns
    ***MENUGROUP=DEPT1
    ***POP1
    [BLAH]
    [BLAH]

    Dept2.mns
    ***MENUGROUP=DEPT2
    ***POP1
    [BLAH]
    [BLAH]
     
    ECCAD, Apr 21, 2004
    #3
  4. kendresen

    Tom Smith Guest

    We have two different groups, needing different commands in one of our
    pulldown menus.

    To reduce maintenance & coordination I wanted to share the same menu between
    groups, so I figured out how to use DIESEL expressions in the menu. There's
    a "check" item at the top of the menu which indicates which group's version
    is active. Top change it, you just check the other -- which runs a lisp
    routine to set the value of useri1 accordingly (thereby storing the setting
    in the drawing) and reload our other lisps, because some of them run
    differently depending on the value of useri1.

    Then depending on which group's menu version is active, DIESEL expressions
    are used to gray out options which aren't available. For instance

    [$(if,$(=,$(getvar,useri1),0),~)&Revision Date]^C^C^PREVDATE;

    One group uses a revision date stamp while the other doesn't.
     
    Tom Smith, Apr 21, 2004
    #4
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.