.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
1375 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