Message 1 of 4
HowTo: Add a ButtonPopup to Inventor GUI?

Not applicable
02-26-2010
02:16 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
I want expand the GUI from a Ribbon with one Button (see below) to a ribbon
with a ButtonPopup for two Buttons. Has someone an example or can expand my
code below? Environment: Inventor 2010 AddIn, with VB.Net 2005, 32 Bit
Many thanks in advance.
doc snyder
Private Sub AddExportButton(ByVal bFirstTime As Boolean)
' Create the button definition.
Dim controlDefs As ControlDefinitions
controlDefs = m_InvApp.CommandManager.ControlDefinitions
' Convert the Image to a Picture.
Dim picSmall As stdole.IPictureDisp, picBig As stdole.IPictureDisp
picSmall =
Microsoft.VisualBasic.Compatibility.VB6.ImageToIPictureDisp(My.Resources.Pic_Export_Small)
picBig =
Microsoft.VisualBasic.Compatibility.VB6.ImageToIPictureDisp(My.Resources.Pic_Export_Big)
m_oButtonDef = controlDefs.AddButtonDefinition( _
"Measure Program Generator", _
"ExportMeasureAddIn", _
CommandTypesEnum.kQueryOnlyCmdType, _
m_ClientID, _
Measure Program Export", _
Measure Program Generator", _
picSmall, picBig)
If bFirstTime Then
' Create a new command bar (toolbar) and make it visible.
Dim commandBars As CommandBars
commandBars = m_InvApp.UserInterfaceManager.CommandBars
Dim commandBar As CommandBar
commandBar = commandBars.Add("Measure Program", "ExportMeasureAddIn",
, m_ClientID)
commandBar.Visible = True
' Add the control to the command bar.
commandBar.Controls.AddButton(m_oButtonDef)
End If
End Sub
I want expand the GUI from a Ribbon with one Button (see below) to a ribbon
with a ButtonPopup for two Buttons. Has someone an example or can expand my
code below? Environment: Inventor 2010 AddIn, with VB.Net 2005, 32 Bit
Many thanks in advance.
doc snyder
Private Sub AddExportButton(ByVal bFirstTime As Boolean)
' Create the button definition.
Dim controlDefs As ControlDefinitions
controlDefs = m_InvApp.CommandManager.ControlDefinitions
' Convert the Image to a Picture.
Dim picSmall As stdole.IPictureDisp, picBig As stdole.IPictureDisp
picSmall =
Microsoft.VisualBasic.Compatibility.VB6.ImageToIPictureDisp(My.Resources.Pic_Export_Small)
picBig =
Microsoft.VisualBasic.Compatibility.VB6.ImageToIPictureDisp(My.Resources.Pic_Export_Big)
m_oButtonDef = controlDefs.AddButtonDefinition( _
"Measure Program Generator", _
"ExportMeasureAddIn", _
CommandTypesEnum.kQueryOnlyCmdType, _
m_ClientID, _
Measure Program Export", _
Measure Program Generator", _
picSmall, picBig)
If bFirstTime Then
' Create a new command bar (toolbar) and make it visible.
Dim commandBars As CommandBars
commandBars = m_InvApp.UserInterfaceManager.CommandBars
Dim commandBar As CommandBar
commandBar = commandBars.Add("Measure Program", "ExportMeasureAddIn",
, m_ClientID)
commandBar.Visible = True
' Add the control to the command bar.
commandBar.Controls.AddButton(m_oButtonDef)
End If
End Sub