thank you, It work well.
Does anyone know how to add RibbonTab for all environment
Recently, I can only add one
If I add more, Add-In doesn't work.
First, I use For....Next but it didn't work. Then I use directly and it didn't work too.
At last, I change to the simplest way, and it only works for one environment.
Dim oRibbon(3) As Inventor.Ribbon
'oRibbon(0) = m_inventorApplication.UserInterfaceManager.Ribbons.Item("Part")
oRibbon(1) = m_inventorApplication.UserInterfaceManager.Ribbons.Item("Assembly")
'oRibbon(2) = m_inventorApplication.UserInterfaceManager.Ribbons.Item("Drawing")
'oRibbon(3) = m_inventorApplication.UserInterfaceManager.Ribbons.Item("Presentation")
'create the newTab
Dim NewTab(3) As Inventor.RibbonTab
'NewTab(0) = oRibbon(0).RibbonTabs.Item("ABC")
NewTab(1) = oRibbon.RibbonTabs.Add("NewTab", "NewTabForAssembly", m_ClientID, "id_GetStarted", False)
'NewTab(2) = oRibbon(1).RibbonTabs.Add("New", "NewTabForDrawing", m_ClientID, "id_GetStarted", False)
'NewTab(3) = oRibbon(1).RibbonTabs.Add("New", "NewTabForPresentation", m_ClientID, "id_GetStarted", False)
'create the new panel on the New Tab
Dim NEWPanel(3) As Inventor.RibbonPanel
'NEWPanel(0) = NewTab(0).RibbonPanels.Add("NEW IT", "NEWITPanel", m_ClientID)
NEWPanel(1) = NewTab.RibbonPanels.Add("NEW IT", "NEWITPanel", m_ClientID)
'NEWPanel(2) = NewTab(2).RibbonPanels.Add("NEW IT", "NEWITPanel", m_ClientID)
'NEWPanel(3) = NewTab(3).RibbonPanels.Add("NEW IT", "NEWITPanel", m_ClientID)
'NEWPanel(0).CommandControls.AddButton(m_Button0Def, True, True)
NEWPanel(1).CommandControls.AddButton(m_Button0Def, True, True)
'NEWPanel(2).CommandControls.AddButton(m_Button0Def, True, True)
'NEWPanel(3).CommandControls.AddButton(m_Button0Def, True, True)