| Author |
Message |
HXA13
Guest
|
Posted:
Sun Mar 20, 2005 2:47 pm Post subject:
Help MenuLoad |
|
|
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
|
|
| Back to top |
|
 |
Alfred NESWADBA
Guest
|
Posted:
Sun Mar 20, 2005 3:03 pm Post subject:
Re: Help MenuLoad |
|
|
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 -
In article <19560060.1111312053206.JavaMail.jive@jiveforum2.autodesk.com>, nospam@address.withheld says...
| Quote: | 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
|
|
|
| Back to top |
|
 |
HXA13
Guest
|
Posted:
Sun Mar 20, 2005 3:19 pm Post subject:
Re: Help MenuLoad |
|
|
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
|
|
| Back to top |
|
 |
Alfred NESWADBA
Guest
|
Posted:
Sun Mar 20, 2005 5:51 pm Post subject:
Re: Help MenuLoad |
|
|
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 -
In article <9485617.1111314030185.JavaMail.jive@jiveforum2.autodesk.com>, nospam@address.withheld says...
| Quote: | 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
|
|
|
| Back to top |
|
 |
HXA13
Guest
|
Posted:
Mon Mar 21, 2005 10:01 am Post subject:
Re: Help MenuLoad |
|
|
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 |
|
| Back to top |
|
 |
Frank Oquendo
Guest
|
Posted:
Mon Mar 21, 2005 10:01 am Post subject:
Re: Help MenuLoad |
|
|
HXA13 wrote:
| Quote: | Anyway, what I am asking, what could be causing this?
|
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. |
|
| Back to top |
|
 |
HXA13
Guest
|
Posted:
Mon Mar 21, 2005 10:01 am Post subject:
Re: Help MenuLoad |
|
|
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 |
|
| Back to top |
|
 |
Frank Oquendo
Guest
|
Posted:
Mon Mar 21, 2005 10:01 am Post subject:
Re: Help MenuLoad |
|
|
HXA13 wrote:
| Quote: | I didn't quite understand what you were suggesting.
|
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. |
|
| Back to top |
|
 |
HXA13
Guest
|
Posted:
Mon Mar 21, 2005 10:01 am Post subject:
Re: Help MenuLoad |
|
|
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 |
|
| Back to top |
|
 |
|
|
|
|