Generic Buttons handler in Inventor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm trying to write a generic button handler for Inventor 2015/2016 in VB.NET 4.5 , that handles genertae multiple icons, and then opens a file from the help menu, to start with I have created a variable as a list of buttons...
Private WithEvents ss_help_buttons As New System.Collections.Generic.List(Of Inventor.ButtonDefinition)
I then poulate the controls from a generic list of some data, and link the buttons to the handler.
Private Sub load_help_menus()
m_uimanager.HelpControls.AddSeparator()
Dim ctr As Integer = 0
Do While ctr < GlobalVars.m_project_file.HelpLinks.Count
Dim new_menu_help_link As Inventor.ButtonDefinition
new_menu_help_link = m_controldefs.AddButtonDefinition(GlobalVars.m_project_file.HelpLinks(ctr).Value.DisplayName, "SOUPIPROPMAN_HELPLINKS_" & ctr.ToString, CommandTypesEnum.kQueryOnlyCmdType, GlobalVars.m_clientId)
AddHandler new_menu_help_link.OnExecute, AddressOf ss_help_run
ss_help_buttons.Add(new_menu_help_link)
m_uimanager.HelpControls.AddButton(ss_help_buttons.Item(ctr))
ctr = ctr + 1
Loop
End Sub
All works well so far and the handler below is triggered when the button is pressed.
Private Sub ss_help_run(context As Inventor.NameValueMap)
Dim n As Integer = 1 'Does nothing just serves a line to break on
End Sub
So my question is, is there any way to get a handle to which button was pressed from inside the handler? (I have interogated "Context" when debugging and can't find any useful data attached.
Thanks