iLogic Interact with dialog box and/or Help convert to VBA
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am trying to interact with the edit select filters dialog box to set up a few pre-selections without manually scrolling through and checking the options I want. I'm trying to write it in iLogic because I'm not very familiar with writing VBA macros; however, from my research so far this would work better as a VBA macro. I have the iLogic code roughed out with the first Pre-selection option I want and some other options to return it to normal for testing purposes:
Dim CustomFilter As ButtonDefinition = ThisApplication.CommandManager.ControlDefinitions.Item("DrawingCustomFiltersCmd")
Dim EditSelectFilter As ButtonDefinition = ThisApplication.CommandManager.ControlDefinitions.Item("DrawingEditSelectFiltersCmd")
Dim SelectAll As ButtonDefinition = ThisApplication.CommandManager.ControlDefinitions.Item("DrawingSelectAllCmd")
Dim OptionsList As New List(Of String) : OptionsList.Add("Edit Selection Filters") : OptionsList.Add("Custom Filter") : OptionsList.Add("Select All")
Dim Options As String = InputListBox("Prompt", OptionsList, OptionsList.Item(2), Title := "OptionsList")
If Options = OptionsList.Item(0)
EditSelectFilter.Execute
'Select None to clear
'Select Hatch box
'Select Okay
CustomFilter.Execute
Else If Options = OptionsList.Item(1)
CustomFilter.Execute
Else If Options = OptionsList.Item(2)
SelectAll.Execute
Else
MessageBox.Show("Error", "Error")
End If
What I'm having an issue with is interacting with the "Edit Select Filter" dialog box options.
I tried using SendKeys.Send("{ENTER}"), which throws an error about inventor is not handling Windows messages, And SendKeys.SendWait("{ENTER}"), which does nothing. Both of those attempts don't fire until the DialogBox is closed.
If this is possible in a VBA Macro, I would like some help with the conversion from iLogic code to VBA code.