Hello,
Does anybody know why my menu group is not saving in the following code.
The following code adds a menu item to the Toolbar Test in a menu group named TEST. However when I exit and re-enter AutoCAD the menu is not saved. I have also tried saveas with no luck.
I am compiling the code **** a .net dll and then running it via lisp.
Any ideas?
'
'(TestAddToolbarItem_dotNet)
'
<LispFunction("TestAddToolbarItem_dotNet")> _
Public Function TestAddToolbarItem_dotNet(Optional ByVal myLispArgs As ResultBuffer = Nothing) As ResultBuffer
Dim acadApp As AcadApplication = Autodesk.AutoCAD.ApplicationServices.Application.AcadApplication
Dim objMenuGroup As AcadMenuGroup = acadApp.Application.MenuGroups.Item("TEST")
Dim objToolbar As AcadToolbar = objMenuGroup.Toolbars.Item("Test")
objToolbar.Visible = True
Dim objNewToolbrItem As AcadToolbarItem = objToolbar.AddToolbarButton(objToolbar.Count, "Test", "", "Macro")
'objMenuGroup.Save(Autodesk.AutoCAD.Interop.Common.AcMenuFileType.acMenuFileSource)
objMenuGroup.Save(Autodesk.AutoCAD.Interop.Common.AcMenuFileType.acMenuFileCompiled)
MsgBox("'" & objMenuGroup.MenuFileName & "' Attempt Menu Group save. But it does not seem to be saving..")
Return myLispArgs
End Function
Kind Regards
David Rock
Solved! Go to Solution.
Solved by Alexander.Rivilis. Go to Solution.
It seems that a CustomizationSection is able to be saved.
However I cannot find a way of getting to the CustomizationSection of an existing menugroup. The only way I can find is to create a new CustomizationSection.
Does anybody know ho to get to the CustomizationSection of an existing menugroup?
There does not seem any point to having the object 'Autodesk.AutoCAD.Interop.IAcadMenuGroup.Save' if it does not work or throw an exception when is does not work.
Any help really appretiated.
Thanks
David
@Anonymous wrote:
There does not seem any point to having the object 'Autodesk.AutoCAD.Interop.IAcadMenuGroup.Save' if it does not work or throw an exception when is does not work.
Last version of AutoCAD which allow to save menugroup with COM interface was 2005.
Autodesk.AutoCAD.Customization help you customize menugroup for AutoCAD 2007+
ObjectARX SDK: samples\dotNet\CuiSamp (ObjectARX SDK 2008 and 2009)
ŠŃŠ“ŠæŠ¾Š²ŃŠ“Ń ŠŗŠ¾ŃŠøŃŠ½Š°? ŠŠ»ŃŠŗŠ½ŃŃŃ Š½Š° "ŠŠŠŠŠŠŠŠŠŠ£" ŃŃŠ¼ ŠæŠ¾Š²ŃŠ“Š¾Š¼Š»ŠµŠ½Š½ŃŠ¼! | Do you find the posts helpful? "LIKE" these posts!
ŠŠ°Ń
Š¾Š“ŠøŃŠµ ŃŠ¾Š¾Š±ŃŠµŠ½ŠøŃ ŠæŠ¾Š»ŠµŠ·Š½ŃŠ¼Šø? ŠŠ¾ŃŃŠ°Š²ŃŃŠµ "ŠŠ ŠŠŠŠ¢Š”ŠÆ" ŃŃŠøŠ¼ ŃŠ¾Š¾Š±ŃŠµŠ½ŠøŃŠ¼!
ŠŠ° Š²Š°ŃŠµ Š·Š°ŠæŠøŃŠ°Š½Š½Ń Š²ŃŠ“ŠæŠ¾Š²ŃŠ»Šø? ŠŠ°ŃŠøŃŠ½ŃŃŃ ŠŗŠ½Š¾ŠæŠŗŃ "ŠŠ ŠŠŠŠÆŠ¢Š Š ŠŠØŠŠŠŠÆ" | Have your question been answered successfully? Click "ACCEPT SOLUTION" button.
ŠŠ° Š²Š°Ń Š²Š¾ŠæŃŠ¾Ń ŃŃŠæŠµŃŠ½Š¾ Š¾ŃŠ²ŠµŃŠøŠ»Šø? ŠŠ°Š¶Š¼ŠøŃŠµ ŠŗŠ½Š¾ŠæŠŗŃ "Š£Š¢ŠŠŠ ŠŠŠ¢Š¬ Š ŠŠØŠŠŠŠ"
Alexander Rivilis / ŠŠ»ŠµŠŗŃŠ°Š½Š“Ń Š ŠøŠ²ŠøŠ»ŠøŃ / ŠŠ»ŠµŠŗŃŠ°Š½Š“Ń Š ŃŠ²ŃŠ»ŃŃ
Programmer & Teacher & Helper / ŠŃŠ¾Š³ŃŠ°Š¼Š¼ŠøŃŃ - Š£ŃŠøŃŠµŠ»Ń - ŠŠ¾Š¼Š¾ŃŠ½ŠøŠŗ / ŠŃŠ¾Š³ŃŠ°Š¼ŃŃŃ - Š²ŃŠøŃŠµŠ»Ń - ŠæŠ¾Š¼ŃŃŠ½ŠøŠŗ
Facebook | Twitter | LinkedIn
There must be some way of editing a cuix menu and saving it? I am trying both lisp and .net methods and both do not save the changes to the menu. Attached is the lisp.
The 2008 class sample is very helpful. However the class is biased towards creating new toolbars and toolbar items. I am having trouble seeing how to iterate through an existing menu, do a find and replace opperation and save the menu.
Regards
David