.Net Add-In fails to add a ribbonbutton on a German Inventor-version.

.Net Add-In fails to add a ribbonbutton on a German Inventor-version.

Anonymous
Not applicable
331 Views
0 Replies
Message 1 of 1

.Net Add-In fails to add a ribbonbutton on a German Inventor-version.

Anonymous
Not applicable

My first thought was that the code was unable to find the correct ribbonpanel because of a different name in other inventor-version. For ex. oApp.UserInterfaceManager.Ribbons("Assembly").RibbonTabs("id_TabTube_Pipe_Run").RibbonPanels("id_PanelA_TubePipeRunManage") that is a working panel-object on English versions maybe had other names (those in ""-marks) on German versions.

 

So I wrote some scan code that iterated thru the ribbons to get the german names:

 

For Each R In oApp.UserInterfaceManager.Ribbons
AddLineToTextFile(My.Application.Info.DirectoryPath & "\Ribbon.txt", "Ribbon InternalName:" & R.InternalName)
For Each RT In R.RibbonTabs
AddLineToTextFile(My.Application.Info.DirectoryPath & "\Ribbon.txt", "    RibbonTab DisplayName:" & RT.DisplayName & "    Internal Name:" & RT.InternalName)
For Each RP In RT.RibbonPanels
AddLineToTextFile(My.Application.Info.DirectoryPath & "\Ribbon.txt", "    RibbonPanels DisplayName:" & RP.DisplayName & "    Internal Name:" & RP.InternalName)
For Each CC In RP.CommandControls
AddLineToTextFile(My.Application.Info.DirectoryPath & "\Ribbon.txt", "    CommandControls DisplayName:" & CC.DisplayName & "    Internal Name:" & CC.InternalName)
Next
Next
Next
Next

The problem was that the collection "oApp.UserInterfaceManager.Ribbons" on a german version was empty.

The scan on an English version worked perfectly.

 

Does anyone have a clue why the collection on a german version is empty or how to create buttons that adapts to different Inventor-language-versions.

0 Likes
332 Views
0 Replies
Replies (0)