Selection of Point Event Handler


#1

Is there an event in RhinoCommon that I can use to detect when a point is selected on a RhinoObject?

I am using SelectObjects event to handle most cases, but when PointsOn is executed on an Object, the DeselectObjects event is fired, but no further selection event for the Point selected occurs.

Also when I enumerate the RhinoObjects in the document even if I have enable Grips to be selected, I do not see any Grip object that is selected.

Can anyone point me in a direction?

Thanks,

Jason Stevenson
Gemvision


(Menno Deij - van Rijswijk) #2

Have you tried the ObjectEnumerator with IncludeGrips=true?

http://4.rhino3d.com/5/rhinocommon/html/T_Rhino_DocObjects_ObjectEnumeratorSettings.htm

Also, this may be of interest. http://4.rhino3d.com/5/rhinocommon/html/M_Rhino_DocObjects_Tables_ObjectTable_GetSelectedObjects.htm


#3

Thanks Menno, but yes, I am using those methods. My problem is know when to look for the selected items.

The **RhinoDoc.**SelectObjects event does not fire when clicking on Points when an object was selected and PointsOn has been executed.

I am trying to provide a custom menu when specific grips are selected in Rhino.

The only thing I can come up with so far was to create a MouseCallback, then handle the MouseUp, start a timer, then check for what was selected. Quite an ugly hack…

Thanks for any help!


(Dale Fugier) #4

You won’t get a RhinoDoc.SelectObjects event when a grip is selected. This is by design.

If a C++ plug-in developer needs to know about grip selection, they must use the newer CRhinoOnChangeObjectSelectState class.

I don’t see a wrapper for this event in RhinoCommon (yet). So, I’ve added a new bug item to get one added in a future service release.


#5

Thanks. Looking forward to next SR.


#6

I am following up on this request… Was this implemented in RhinoCommon ?
Also, l looked thru SampleCsEventHandlers.cs but could not seem to find an event handler triggered upon grip selection.
Thanks,
Jean


(Dale Fugier) #7

Hi Jean,

Looks like its still on the to-do list.

https://mcneel.myjetbrains.com/youtrack/issue/RH-28524

– Dale