Hi @Anonymous
You must change the selection filter to kDrawingCurveSegmentFilter in WindowSelect if you want to be able to select curves in a drawing. Edge type is for edges on surfacebodies.
Also in preselct the variable should be changed to drawingcurvesegment.
See below code. I've also changed it to create a class "clsSelect" as suggested in the help. But if you just do the changes mentioned above it should work.
Imports Inventor
Public Class Form1
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim oSelect As New clsSelect
oSelect.WindowSelect()
End Sub
End Class
Class clsSelect
Private WithEvents oInteractEvents As InteractionEvents
Private WithEvents oSelectEvents As SelectEvents
Private bTooltipEnabled As Boolean
Private ThisApplication = GetObject(, "Inventor.Application")
Public Sub WindowSelect() 'Might as well be a sub
' Create an InteractionEvents object.
oInteractEvents = ThisApplication.CommandManager.CreateInteractionEvents
' Ensure interaction is enabled.
oInteractEvents.InteractionDisabled = False
' Set a reference to the select events.
oSelectEvents = oInteractEvents.SelectEvents
' Set the filter for circular edges (this includes circular arcs).
oSelectEvents.AddSelectionFilter(SelectionFilterEnum.kDrawingCurveSegmentFilter) 'Changed filter
oSelectEvents.WindowSelectEnabled = True
bTooltipEnabled = ThisApplication.GeneralOptions.ShowCommandPromptTooltips
ThisApplication.GeneralOptions.ShowCommandPromptTooltips = True
oInteractEvents.StatusBarText = "Window select. Esc to exit."
' Start the InteractionEvents object.
oInteractEvents.Start()
End Sub
Private Sub oInteractEvents_OnTerminate()
' Reset to original value
ThisApplication.GeneralOptions.ShowCommandPromptTooltips = bTooltipEnabled
' Clean up.
oSelectEvents = Nothing
oInteractEvents = Nothing
End Sub
Private Sub oSelectEvents_OnPreSelect(ByRef PreSelectEntity As Object, ByRef DoHighlight As Boolean, ByRef MorePreSelectEntities As ObjectCollection, SelectionDevice As SelectionDeviceEnum, ModelPosition As Point, ViewPosition As Point2d, View As View) Handles oSelectEvents.OnPreSelect
Dim oCurve As DrawingCurveSegment 'Changed
oCurve = PreSelectEntity
If Not oCurve.GeometryType = Curve2dTypeEnum.kCircleCurve2d Then
DoHighlight = False
End If
End Sub
Private Sub oSelectEvents_OnSelect(ByVal JustSelectedEntities As ObjectsEnumerator, ByVal SelectionDevice As SelectionDeviceEnum, ByVal ModelPosition As Point, ByVal ViewPosition As Point2d, ByVal View As View) Handles oSelectEvents.OnSelect
MsgBox("Picked " & oSelectEvents.SelectedEntities.Count & " circular curves.")
End Sub
End Class