MrB
28-10-2005, 03:03 PM
Hi
I've copied one of the samples that comes with AutoCad 2004 to add a custom menu set under Modify. These appear ok but I can't work out how to format the command to get the menu option to run another of my methods in the VBA project.
code snippet:
For Each oPopup In oAcad.MenuBar
'TagString is not localized so use it to locate the menu
If oPopup.TagString = "ID_MnModify" Then
Set oSubPopup = oPopup.AddSubMenu(0, "Windchill")
'set TagString to a known value; we'll use this during removal
oSubPopup.Parent.TagString = "ID_MyModify"
Set oPopupMenuItem = oSubPopup.AddMenuItem(0, "Login", "Project.SchematicModule.ShowLoginDialog")
If I use the above, nothing happens, if I try to prefix it with vbarun then I get a dialog box popping up for me to select a method from. There has to be a simple format for this "Macro As string" argument that does this... Anyone know what it is?
Thanks and regards
Ian
I've copied one of the samples that comes with AutoCad 2004 to add a custom menu set under Modify. These appear ok but I can't work out how to format the command to get the menu option to run another of my methods in the VBA project.
code snippet:
For Each oPopup In oAcad.MenuBar
'TagString is not localized so use it to locate the menu
If oPopup.TagString = "ID_MnModify" Then
Set oSubPopup = oPopup.AddSubMenu(0, "Windchill")
'set TagString to a known value; we'll use this during removal
oSubPopup.Parent.TagString = "ID_MyModify"
Set oPopupMenuItem = oSubPopup.AddMenuItem(0, "Login", "Project.SchematicModule.ShowLoginDialog")
If I use the above, nothing happens, if I try to prefix it with vbarun then I get a dialog box popping up for me to select a method from. There has to be a simple format for this "Macro As string" argument that does this... Anyone know what it is?
Thanks and regards
Ian