Menu reloading

Discussion in 'AutoCAD' started by jlspartz, Dec 13, 2004.

  1. jlspartz

    jlspartz Guest

    I'm making a command 'reload' to reload all the menus and insert the pulldowns into the correct locations. So far I've got this for my code:

    (defun c:reload()
    (if (NOT (menugroup "ACAD"))(command "_.MENULOAD" "C:\\PRA CAD\\adt2005\\menus\\acad.mns"))
    (if (NOT (menugroup "ADT"))(command "_.MENULOAD" "C:\\PRA CAD\\adt2005\\menus\\ADT.mns"))
    (if (NOT (menugroup "ADT_DESIGN"))(command "_.MENULOAD" "C:\\PRA CAD\\adt2005\\menus\\ADTDesign.mns"))
    (if (NOT (menugroup "ADT_DOCUMENT"))(command "_.MENULOAD" "C:\\PRA CAD\\adt2005\\menus\\ADTDocument.mns"))
    (if (NOT (menugroup "AECARCHXOE"))(command "_.MENULOAD" "C:\\PRA CAD\\adt2005\\menus\\AecArchXOE.mns"))
    (if (NOT (menugroup "EXPRESS"))(command "_.MENULOAD" "C:\\PRA CAD\\adt2005\\menus\\acetmain.mns"))
    (if (NOT (menugroup "PRAmenu"))(command "_.MENULOAD" "C:\\PRA CAD\\adt2005\\menus\\pramenu.mns"))
    (menucmd "P1=+ADT.POP1")
    (menucmd "P2=+ADT.POP2")
    (menucmd "P3=+ADT.POP3")
    (menucmd "P4=+ADT.POP4")
    (menucmd "P5=+ADT.POP5")
    (menucmd "P6=+ACAD.POP6")
    (menucmd "P7=+ACAD.POP7")
    (menucmd "P8=+ACAD.POP8")
    (menucmd "P9=+ACAD.POP9")
    (menucmd "P10=+PRAmenu.POP30")
    (menucmd "P11=+ADT_DESIGN.POP1")
    (menucmd "P12=+ADT_DOCUMENT.POP1")
    (menucmd "P13=+EXPRESS.POP1")
    (menucmd "P14=+ADT.POP6")
    (menucmd "P15=+ADT.POP7")
    )

    But there's one problem, when the menu is missing and it reloads that menu, some pulldowns automatically show up right away and others do not. I want to remove all pulldowns that show up right when the menu is loaded and then I'll load the ones I want. How do I remove pulldowns?
     
    jlspartz, Dec 13, 2004
    #1
  2. jlspartz

    Big 'D' Guest

    Have you tried creating a profile for your menu settings? You can save the profile anyplace you want.
    In case you are not familiar with this and it will work for you:
    Go to Tools, Options, and profiles, Add to List
    Give your profile a name and location (and description if you wish). Any time your menus and toolbars get scramble, you can go to this tab and import the desired saved profile.

    D
     
    Big 'D', Dec 13, 2004
    #2
  3. jlspartz

    jlspartz Guest

    Yes, I have a profile too, and that is the other way of doing it. But, I would have to figure out how to make a dummy profile, switch to the dummy profile, delete the desired profile, reimport the desired profile, set the desired profile current, and delete the dummy profile in lisp then. The profile way would be more beneficial, but I'm not sure how to go about doing that.
     
    jlspartz, Dec 13, 2004
    #3
  4. jlspartz

    Tom Smith Guest

    I'm making a command 'reload' to reload all the menus and insert the
    pulldowns into the correct locations.

    Why are you doing all this? My menus reload properly everytime I start Acad,
    and pulldowns never move around. Whatever menus are loaded in your profile
    should behave this way, if there aren't errore in the menu files.
     
    Tom Smith, Dec 13, 2004
    #4
  5. jlspartz

    OLD-CADaver Guest

    What are you trying to accomplish? Once the profile is set, the menus should load each time to execute that profile, you don't need to do anything with "dummy" profiles in lisp or otherwise.

    If you wish, you can export that profile for use on other machines, and you can force ACAD to use that profile by editing the target to include /p <profile name>.
     
    OLD-CADaver, Dec 13, 2004
    #5
  6. jlspartz

    jlspartz Guest

    There's no errors in the menu files. It's for the case of any networking issues. If there is a problem at any time on the IT side and the user's pc doesn't find the network license the menus don't load up the way they are suppose to (they are come up missing) after reconnecting to the network (at least with 2002 - haven't come up with that with 2005 yet).

    The shortcut all users have are set to load the profile, but it still doesn't work because it was opened before with no menus or toolbars, so it remembers that. So, the quick way is to tell everyone to type in a command, but we could tell them to import the profile instead. It's just a matter of getting it across to the 50% that don't know what importing a profile even means.
     
    jlspartz, Dec 13, 2004
    #6
  7. jlspartz

    Tom Smith Guest

    It's for the case of any networking issues.

    Thanks for the explanation. Perhaps someone has a solution on forcing the
    placement of toolbars.

    I do standalone installations and actually keep all customizations on the
    local machines. I know that may seem horribly backwards, but I believe it
    saves me considerably more headaches than it causes -- this being a case in
    point. Problems of this type simply don't happen.

    If the network is down, obviously we don't have access to open drawing
    files, but otherwise all our computers will run exactly the same. If the
    server crashes, you can do a "saveas" to the local drive and keep working on
    the files you had open. Maintenance isn't an issue because there's a
    "master" read-only copy of our customizations on the network, and I use an
    acad.lsp to automatically check for and download anything that has changed.
    Everyone's Acad setup is synched to the central copy, but it's kept locally.
    I only maintain the central copy.

    With 2005 we're going to be forced to make a painful decision on whether to
    keep this up or go to a network license system.
     
    Tom Smith, Dec 13, 2004
    #7
  8. jlspartz

    Big 'D' Guest

    Try this:
    To make a profile current before starting AutoCAD

    1. On the Windows desktop, right-click the AutoCAD icon to display the shortcut menu.

    2. Choose Properties from the shortcut menu.

    3. In the AutoCAD Properties dialog box, choose the Shortcut tab.

    4. Under Target, enter /p currentprofile after the current target directory. For example, to make the profile User12 current, enter the following in Target:
    "c:\AutoCAD 2002\acad.exe"/p user12

    5. Choose OK to exit the dialog box.

    The profile name you enter is the current profile each time you start AutoCAD.
    If your server goes down and someone opens AutoCAD - it will use the default profile in the AutoCAD support files. Another way to prevent losing the menus/toolbars is to have the profile on each machine (along with all the support files for those menus - which makes additional customization for all a full time job, reloading all the time).
     
    Big 'D', Dec 13, 2004
    #8
  9. jlspartz

    jlspartz Guest

    Well, maybe I will just leave the reload command off. I think we are not going to need it this time, because on user login we have scripts that copy over menu files to each user's local drive along with other support files, so it shouldn't lose the location of them since all the paths are pointing to their C: with this setup.
     
    jlspartz, Dec 13, 2004
    #9
  10. jlspartz

    OLD-CADaver Guest

    <<So, the quick way is to tell everyone to type in a command, but we could tell them to import the profile instead. It's just a matter of getting it across to the 50% that don't know what importing a profile even means. >>

    Sounds like a training opportunity to me. It's just as easy to teach them to import a pofile as to teach them a new command.
     
    OLD-CADaver, Dec 14, 2004
    #10
  11. jlspartz

    OLD-CADaver Guest

    <<because on user login we have scripts that copy over menu files to each user's local drive along with other support files, >>

    Yikes, whatever for? Networked files work quite well.
     
    OLD-CADaver, Dec 14, 2004
    #11
  12. jlspartz

    Rick Keller Guest

    I understand completely why you would want something to correct your menus.
    For the longest time I had AutoCAD loading my menus EVERY time AutoCAD
    loaded... talk about a time waster!!
    But I got smart and after reading the posts realized that once you have the
    menus set they stay that way..... most of the time.

    When they change back for some unknown reason I have a routine that loads my
    menus.
    Also when I make a change to the menu and want it reloaded I use this
    routine.

    I load 3 menus:
    The acad menu without the buttons.
    A default menu for the stuff I want everyone to have
    A menu of just buttons for each individual to have (starting with all
    default buttons).
    Here is my code I use the WHO variable to get the name of the person so I
    can load that persons menu.
    I just totally scrap whatever menus are loaded and reset all of them... Like
    everyone is saying you don't have to do this often.
    Also....
    Even if you do not have AutoCAD running from a network location you can
    still place your menus & lisp & fonts & other shareable files in a
    network shared folder.

    It is much easier to change the pulldowns then when someone reopens a
    drawing the new pulldowns are there.

    (defun c:nl ()
    (SETQ WHO (GETVAR "LOGINNAME"))
    (COMMAND "MENU" "ACAD")
    (command "menuload" who)
    (command "menuload" "nl")
    (menucmd "P17=+nl.pop1")
    (menucmd "P17=+nl.pop2")
    (menucmd "P17=+nl.pop3")
    (menucmd "P17=+nl.pop4")
    (menucmd "P17=+nl.pop5")
    (menucmd "P18=+nl.pop6")
    (menucmd "P19=+nl.pop7")
    (command "menuload" "acetmain")
    (menucmd "p11=+express.pop1")
    )

    Rick
     
    Rick Keller, Dec 14, 2004
    #12
  13. jlspartz

    jlspartz Guest

    Hi Rick, it looks like you do exactly what I am doing, but do you know how to subtract a pulldown instead of add?
     
    jlspartz, Dec 14, 2004
    #13
  14. jlspartz

    Rick Keller Guest

    I personally do not or have not but...

    OK just figured it out...

    (menucmd "Gnl.pop4=-")

    This will remove the pop4 menu from my NL menugroup See my earlier example
    for the things I am loading.

    The G is required for some reason.

    Hope this helps

    Rick
     
    Rick Keller, Dec 14, 2004
    #14
  15. jlspartz

    ECCAD Guest

    At the 'top' of your routine.. add:
    (Command "_menu" ".")
    This will strip all menus existing. Then,
    your routine will just load the stuff you want.

    Bob
     
    ECCAD, Dec 14, 2004
    #15
  16. jlspartz

    jlspartz Guest

    Thanks, If I wrote that I wouldn't have to do the IF NOT menugroup statement. But, I'm just going to leave that since it's already in there, and if it's loaded it will be quicker the way I got it.

    I figured it out though.
    It goes like this:

    (menucmd "P1=-*")

    That will delete any pulldown name that is in position 1 currently.
     
    jlspartz, Dec 17, 2004
    #16
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.