.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

AcadMenuGroup Menu group edit not saving

3 REPLIES 3
SOLVED
Reply
Message 1 of 4
david.rock
1360 Views, 3 Replies

AcadMenuGroup Menu group edit not saving

 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

 

3 REPLIES 3
Message 2 of 4
david.rock
in reply to: david.rock

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

 

Message 3 of 4


@david.rock 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
Expert Elite Member

Message 4 of 4

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

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost