Why does MNL load TWICE?

Discussion in 'AutoCAD' started by GTVic, Dec 2, 2004.

  1. GTVic

    GTVic Guest

    I noticed that when using the MENU and MENULOAD commands that the MNL file is loaded once for each open drawing...

    Do the following (I did it with the Express menu):
    - Load two or three drawings in AutoCAD 2005
    - Place a (princ "\nHELLO") statement in your MNL file
    - Use the MENU or MENULOAD command to reload the ACAD base menu
    - Use the MENULOAD command to reload your menu

    You should see HELLO two or three times. My guess is that it is reloading the menu for each open drawing but then shouldn't the second and third HELLO go into the text windows for the second and third drawings???
     
    GTVic, Dec 2, 2004
    #1
  2. GTVic

    liftedaxis Guest

    this only happens when you forcible unload and reload the menu with the menuload command.
    normally you would never do this, and the MNL will just load once.

    --Jeremiah
     
    liftedaxis, Dec 2, 2004
    #2
  3. GTVic

    GTVic Guest

    I guess there is probably nothing wrong here - just a little oddity.
     
    GTVic, Dec 2, 2004
    #3
  4. This is by-design.

    If it only loaded for the current drawing, that would not be
    very helpful if you needed to use the loaded code in another
    open drawing, would it?

    Since the .MNL loads once for each drawing that you open,
    it should be loaded into each document if the menu is
    loaded via MENULOAD or MENU.
     
    Tony Tanzillo, Dec 2, 2004
    #4
  5. GTVic

    GTVic Guest

    Yes, it is just a little odd that if the MNL displays some data AutoCAD directs all copies of the output to the text window of the current drawing rather than one copy to each text window. But I guess if some command was active in the other windows that would not be too good - maybe a better choice would be to suppress the output.

    I did a test defining a LISP function in the MNL and having it running in one DWG. Then I reloaded the MNL with an updated version of the function in another drawing and then switched back to the 1st DWG.

    The function in the 1st DWG ran to completion in its original form (doing operations that were not in the updated version). When I executed the function again it was successfully modified. I'm impressed that Autodesk got that to work.
     
    GTVic, Dec 2, 2004
    #5
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.