- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
How do I add a button here
According to ChatGPT this code should work but "CustomizationManager" is not recognized
Private Sub AddToCustomization(btnDef As ButtonDefinition)
' Get the customization manager.
Dim customizationMgr As CustomizationManager = g_inventorApplication.CommandManager.CustomizationManager
' Show the Customize dialog to allow users to customize the ribbon.
customizationMgr.EditCustomize()
' Note: The EditCustomize() method will open the Customize dialog, allowing users to add the button to any ribbon or toolbar they choose.
' Users can drag and drop the button from the "Commands" list to the desired ribbon tab or panel.
End Sub
But only thing i managed to do is this sample that is hardcoded
With this code
"User interface definition"
' Sub where the user-interface creation is done. This is called when
' the add-in loaded and also if the user interface is reset.
Private Sub AddToUserInterface()
' This is where you'll add code to add buttons to the ribbon.
'** Sample to illustrate creating a button on a new panel of the Tools tab of the Part ribbon.
'' Get the part ribbon.
Dim partRibbon As Ribbon = g_inventorApplication.UserInterfaceManager.Ribbons.Item("Part")
'' Get the "Tools" tab.
Dim toolsTab As RibbonTab = partRibbon.RibbonTabs.Item("id_TabTools")
'' Create a new panel.
Dim customPanel As RibbonPanel = toolsTab.RibbonPanels.Add("Sample", "MysSample", AddInClientID)
'' Add a button.
customPanel.CommandControls.AddButton(m_sampleButton)
End Sub
Solved! Go to Solution.