Message 1 of 5
VB.NET SelectEvents Filter Problem
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I've struggled with this for two days now and can't figure it out. I'm calling a form with an add-in to Inventor 2017. This form is the troublemaker:
Imports Inventor Public Class ViewsForm Private m_interactionEvents As InteractionEvents Private m_selectEvents As SelectEvents Private Sub ViewsForm_Shown(sender As Object, e As EventArgs) Handles Me.Shown m_interactionEvents = g_inventorApplication.CommandManager.CreateInteractionEvents() m_interactionEvents.StatusBarText() = "Select part views to label" m_selectEvents = m_interactionEvents.SelectEvents m_selectEvents.AddSelectionFilter(SelectionFilterEnum.kAllEntitiesFilter) m_selectEvents.SingleSelectEnabled = False m_interactionEvents.Start() End Sub Private Sub cmdOK_Click(sender As Object, e As EventArgs) Handles cmdOK.Click Dim selectedViews As New Collection For Each drawingView As DrawingView In m_selectEvents.SelectedEntities selectedViews.Add(drawingView) Next MsgBox(selectedViews.Count) End Sub Private Sub cmdCancel_Click(sender As Object, e As EventArgs) Handles cmdCancel.Click Me.Close() End Sub End Class
I'm able to call the form from the ribbon no problem, but the SelectEvents interaction won't allow the user to select anything in Inventor. It's as if the SelectionFilter isn't letting anything through at all. I'm not getting any error at compilation or runtime, but I'm using VS2017 Community, so I don't have real-time debugging. Can anyone help please?