- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm starting a OnSelect Event on a form load. My wish is to when the user is selecting a sketchline in the model there will be interaction with the form eventually. But I ran into a road block with the OnSelect Event. I have found that it keeps the selection as the selection happens. For example if they select one line and then select another it keeps the previous lines selection and the one that was just selected. I don't think this is the intention so I'm assuming I'm not handling the event correctly. Any help would be appreciated. I tried to use the clear the select set but it has not effect on the onselect event.
Class Properties
Private formInteractionEvents As Inventor.InteractionEvents
Private formSelectEvents As Inventor.SelectEvents
Load
Private Sub ConfigureForm_Load(sender As Object, e As EventArgs) Handles MyBase.Load
formInteractionEvents = g_inventorApplication.CommandManager.CreateInteractionEvents()
formSelectEvents = formInteractionEvents.SelectEvents
AddHandler formSelectEvents.OnSelect, AddressOf SelectEvents_OnSelect
formInteractionEvents.Start()
End Sub
OnSelect Event
Public Sub SelectEvents_OnSelect(ByVal JustSelectedEntities As Inventor.ObjectsEnumerator, ByVal SelectionDevice As Inventor.SelectionDeviceEnum, ByVal ModelPosition As Inventor.Point, ByVal ViewPosition As Inventor.Point2d, ByVal View As Inventor.View)
Dim currentSelectSet As SelectSet = g_inventorApplication.ActiveDocument.SelectSet
Dim selectedSketchLine As SketchLine = JustSelectedEntities _
.OfType(Of Object)() _
.Where(Function(entity) TypeOf entity Is SketchLine) _
.Select(Function(entity) CType(entity, SketchLine)) _
.FirstOrDefault()
currentSelectSet.Clear()
'RemoveHandler _selectEvents.OnSelect, AddressOf SelectEvents_OnSelect
''_interactionEvents = Nothing
End Sub
Tiffany Hayden
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
Solved! Go to Solution.