Help MenuLoad

Discussion in 'AutoCAD' started by HXA13, Mar 20, 2005.

  1. HXA13

    HXA13 Guest

    Hello Everyone ,,, I have a problem with a menu that I've created. Everytime I load it using Menuload or VBA Code, all previous loaded menus disappear. Even the Acad.mns. I don't even where to seek help beside here.
    I appreciate your help.
    HXA
     
    HXA13, Mar 20, 2005
    #1
  2. should not be, if you use 'menuload' and not 'menu'.

    it may occur if your menue-items do have same names like in
    default 'acad.mns' (or 'acad.mnu').
    if your menue is not to large, then attach it to your answer
    so we can look into it.

    - alfred -
     
    Alfred NESWADBA, Mar 20, 2005
    #2
  3. HXA13

    HXA13 Guest

    Hi again, thanks for your last reply. Actually the one I am having problem with is very long but a work-mate is having the same problem with another menu that I personally load successfully. Wierd. anyway here is is

    //
    // AutoCAD menu file - C:\ACAD\supp\mun\sacsMenu.mns
    //

    ***MENUGROUP=SacsMenu

    ***POP2
    ID_mnuAutoSACS [&Auto-SACS]
    ID_mnuTitle_Block [->Title Block]
    ID_Data_Entry [Data Entry]^C^C-vbarun data_entry
    ID_Validation [Validation]^C^C-vbarun validation
    ID_Validation_Report [Validation Report]^C^C-vbarun plantDoc_output_report
    ID_P_output_R [PlantDoc Output Report]^C^C-vbarun plantDoc_output_report
    ID_Help [<-Help]^C^C-vbarun help
    ID_Products [->Products]
    ID_Pid [PID]^C^C_-vbarun product "@PID/pid.dwg"
    ID_Ild [ILD]^C^C_-vbarun product "@ILD/ild.dwg"
    ID_E1l [E1L]^C^C_-vbarun product "@E1L/e1l.dwg"
    ID_Vod [VOD]^C^C_-vbarun product "@PID/pid.dwg"
    ID_ISO [ISO]^C^C_-vbarun product "@ISO/iso.dwg"
    ID_Com [COM]^C^C_-vbarun product "@COM/comm.dwg"
    ID_Fpp [FPP]^C^C_-vbarun product "@FPP/fpp.dwg"
    ID_Ppl [PPL]^C^C_-vbarun product "@PPL/pplall.dwg"
    ID_Edt [EDT]^C^C_-vbarun product "@EDT/edtall.dwg"
    ID_Civ [CIV]^C^C_-vbarun product "@CIV/civall.dwg"
    ID_Arc [ARC]^C^C_-vbarun product "@ARC/arcall.dwg"
    ID_Hva [HVA]^C^C_-vbarun product "@HVA/hvaall.dwg"
    ID_Uti [UTI]^C^C_-vbarun product "@UTI/utiall.dwg"
    ID_Gen [<-GEN]^C^C_-vbarun product "@GEN/gen.dwg"

    ID_Auto_Sacs_Version__0 [Auto-Sacs Version ]^C^C_vbaman
    ID_Release_Notes_0 [Release Notes]^C^C-vbarun release


    //
    // End of AutoCAD menu file - C:\ACAD\supp\mun\sacsMenu.mns


    this menu function just like it supposed to do.

    HXA
     
    HXA13, Mar 20, 2005
    #3
  4. hi,

    i have loaded your menu with 'menuload' and don't have the problem that other parts
    disappear, what version of acad are you running?

    - alfred -
     
    Alfred NESWADBA, Mar 20, 2005
    #4
  5. HXA13

    HXA13 Guest

    Hello,
    I am running AutoCAD 2002.
    As I told you, I personally don't have a problem with that particular menu but my work-mate does. Whenever he loads this menu it replaces all other menus. Anyway, what I am asking, what could be causing this?
    Note: when you do menu load there is a check box name "replace all" I wonder if this menu trigger that by any way!!!
    thanks again
    HXA
     
    HXA13, Mar 21, 2005
    #5
  6. My guess is your coworker. If you have not already done so, use the
    MENULOAD command to load the menu for him and see if the problem persists.

    If the problem disappears, check the VBA code.
     
    Frank Oquendo, Mar 21, 2005
    #6
  7. HXA13

    HXA13 Guest

    Hello Frank,
    I didn't quite understand what you were suggesting. I mean, It doesn't matter what's loading the menu, Menuload command or just Menugroups.load, the new menu still replace the others. I know it is not supposed to happen but it is happening and I've been thinking a lot about this but not really quite understand why it is doint his. anyway guys, here is the way this menu is being loaded. In my Setup1 file I add three lines to the acad2000.lsp file to load the VBA, The menu group, the menu bar automaticly.

    Sub AddToLispStartUp()
    Dim fs, AC_StartupLispFile: Set fs = CreateObject("Scripting.FileSystemObject")
    Set AC_StartupLispFile = fs.OpenTextFile(cad_path & "Support\acad2000.lsp", 8, 0)
    AC_StartupLispFile.writeline vbNewLine
    AC_StartupLispFile.writeline ";;;THE FOLLOWING TWO LINES ADDED BY AUTOSACS INSTALLER"
    AC_StartupLispFile.writeline "(command " & """" & "menuload" & """" & " " & """" & "C:\\ACAD\\supp\\mnu\\SacsMenu.mns" & """" & " ^C^C)"
    AC_StartupLispFile.writeline "(vl-vbaload " & """" & "C:\\ACAD\\supp\\VBA\\Sacs.dvb" & """" & ")"
    AC_StartupLispFile.writeline "(command " & """" & "vbarun" & """" & " " & """" & "LoadSacsMenu" & """" & ")"
    AC_StartupLispFile.Close

    End Sub

    In my VBA,
    Public Sub LoadSacsMenu()
    Dim MenuGroupObject As AcadMenuGroup
    On Error GoTo err_hand
    With ThisDrawing.Application
    Set MenuGroupObject = ThisDrawing.Application.MenuGroups.Item(.MenuGroups.Count - 1)
    MenuGroupObject.Menus.InsertMenuInMenuBar MenuGroupObject.Menus.Item(0).Name, .MenuBar.Count - 1
    End With
    err_hand:
    End Sub

    One more time, this code work really good in my station. However, I am facing the same problem as my coworker with another menu.

    HXA
     
    HXA13, Mar 21, 2005
    #7
  8. HXA13

    HXA13 Guest

    Hello Frank,
    I didn't quite understand what you were suggesting. I mean, It doesn't matter what's loading the menu, Menuload command or just Menugroups.load, the new menu still replace the others. I know it is not supposed to happen but it is happening and I've been thinking a lot about this but not really quite understand why it is doint his. anyway guys, here is the way this menu is being loaded. In my Setup1 file I add three lines to the acad2000.lsp file to load the VBA, The menu group, the menu bar automaticly.

    Sub AddToLispStartUp()
    Dim fs, AC_StartupLispFile: Set fs = CreateObject("Scripting.FileSystemObject")
    Set AC_StartupLispFile = fs.OpenTextFile(cad_path & "Support\acad2000.lsp", 8, 0)
    AC_StartupLispFile.writeline vbNewLine
    AC_StartupLispFile.writeline ";;;THE FOLLOWING TWO LINES ADDED BY AUTOSACS INSTALLER"
    AC_StartupLispFile.writeline "(command " & """" & "menuload" & """" & " " & """" & "C:\\ACAD\\supp\\mnu\\SacsMenu.mns" & """" & " ^C^C)"
    AC_StartupLispFile.writeline "(vl-vbaload " & """" & "C:\\ACAD\\supp\\VBA\\Sacs.dvb" & """" & ")"
    AC_StartupLispFile.writeline "(command " & """" & "vbarun" & """" & " " & """" & "LoadSacsMenu" & """" & ")"
    AC_StartupLispFile.Close

    End Sub

    In my VBA,
    Public Sub LoadSacsMenu()
    Dim MenuGroupObject As AcadMenuGroup
    On Error GoTo err_hand
    With ThisDrawing.Application
    Set MenuGroupObject = ThisDrawing.Application.MenuGroups.Item(.MenuGroups.Count - 1)
    MenuGroupObject.Menus.InsertMenuInMenuBar MenuGroupObject.Menus.Item(0).Name, .MenuBar.Count - 1
    End With
    err_hand:
    End Sub

    One more time, this code work really good in my station. However, I am facing the same problem as my coworker with another menu.

    HXA
     
    HXA13, Mar 21, 2005
    #8
  9. You operate his station, use the MENULOAD command and see what happens.

    12 years of doing AutoCAD tech support has taught me to observe
    technical issues firsthand whenever possible.

    BTW, why all the code to load a partial menu? Load it once, leave it
    loaded and AutoCAD will automatically reload it at the start of the next
    session.
     
    Frank Oquendo, Mar 21, 2005
    #9
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.