In-Place Edit -> Interactive selected profile does not trigger "OnSelect"

In-Place Edit -> Interactive selected profile does not trigger "OnSelect"

gilsdorf_e
Collaborator Collaborator
305 Views
1 Reply
Message 1 of 2

In-Place Edit -> Interactive selected profile does not trigger "OnSelect"

gilsdorf_e
Collaborator
Collaborator

In-place edit drives me nuts.

I'm now stuck with interactive selection while doing in "in-place edit" on a part inside an assembly. It's working fine for face proxies, but not for profiles.

 

I define a selection filter to make only sketched profiles selectable.

 

m_selectEvents.AddSelectionFilter(SelectionFilterEnum.kSketchProfileFilter);

 

OnPreSelect is triggered and highlights the profile, when mouse hovers over the profile. You can even interactively click on the highlighted area and the area stays highlighted when you move away the mouse.

But this simply does not trigger "OnSelect" event which works fine in in-place edit for faces. Selecting profiles also works when done with the same part as active document in part context.

Only the combination "in-place edit" and "Profile" selection does not work. I already found profiles being very special in the past.

0 Likes
Accepted solutions (1)
306 Views
1 Reply
Reply (1)
Message 2 of 2

Michael.Navara
Advisor
Advisor
Accepted solution

I confirm this. It looks like a bug.

My research note: Before the profile is selected, PreSelect event is fired only when preselected profile is changed. After the first profile is selected, the PreSelect event fires several times when the mouse moves over the selected profile.

 

Here is simple iLogic test code.

Sub Main()

    Dim oInteractionEvents As InteractionEvents = ThisApplication.CommandManager.CreateInteractionEvents()
    Dim oSelectEvents As SelectEvents = oInteractionEvents.SelectEvents

    SharedVariable("SelectEvents") = oSelectEvents
    SharedVariable("InteractionEvents") = oInteractionEvents

    oSelectEvents.AddSelectionFilter(SelectionFilterEnum.kSketchProfileFilter)

    AddHandler oSelectEvents.OnPreSelect, AddressOf SelectEvents_OnPreSelect
    AddHandler oSelectEvents.OnSelect, AddressOf SelectEvents_OnSelect
    AddHandler oInteractionEvents.OnTerminate, AddressOf InteractionEvents_OnTerminate

    oInteractionEvents.Start()
End Sub

Private Sub SelectEvents_OnPreSelect(ByRef preselectentity As Object, ByRef dohighlight As Boolean, ByRef morepreselectentities As ObjectCollection, selectiondevice As SelectionDeviceEnum, modelposition As Point, viewposition As Point2d, view As Inventor.View)
    dohighlight = True
    Logger.Debug("Preselected entity: {0}", [Enum].GetName(GetType(ObjectTypeEnum), preselectentity.Type))
End Sub

Private Sub SelectEvents_OnSelect(justselectedentities As ObjectsEnumerator, selectiondevice As SelectionDeviceEnum, modelposition As Point, viewposition As Point2d, view As Inventor.View)
    Logger.Debug("Selected enities: {0}", justselectedentities.Count)
End Sub

Private Sub InteractionEvents_OnTerminate()

    Dim oSelectEvents As SelectEvents = SharedVariable("SelectEvents")
    RemoveHandler oSelectEvents.OnPreSelect, AddressOf SelectEvents_OnPreSelect
    RemoveHandler oSelectEvents.OnSelect, AddressOf SelectEvents_OnSelect

    Dim oInteractionEvents As InteractionEvents = SharedVariable("InteractionEvents")
    RemoveHandler oInteractionEvents.OnTerminate, AddressOf InteractionEvents_OnTerminate
    oInteractionEvents.Stop()

    SharedVariable.Remove("SelectEvents")
    SharedVariable.Remove("InteractionEvents")

    Logger.Debug("Stoped")
End Sub