Rhinocommon Events

Hi,
I’m trying to use the event handler when an object is selected (in vb.net) but I can’t figure out how to do this? I tried to add the code below to my plugin but it doesn’t work? Thanks for helping!
Matthieu

   Public Shared Event SelectObjects As EventHandler(Of Rhino.DocObjects.RhinoObjectSelectionEventArgs)
    Private Sub testEventSelectObject(sender As Object, e As EventArgs) Handles MyClass.SelectObjects
        MsgBox("Event")
    End Sub

Hi Matthieu,

Let me know if this sample is helpful.

https://github.com/dalefugier/SampleVbCommands/blob/master/SampleVbSelectEventHandler.vb

– Dale

Thanks it is really helpful.
Just on small thing: I don’t really need the 'DeselectObject" event, but it feels weird because it doesn’t raise an event when I deselect by clicking an empty spot.
(My bad, i did’nt see the event “DeselectAllObjects”)