RhinoCommon: Event Watcher for specific GUID

Hi,
Two questions:

  1. Is it possible to register Event Watcher for specific GUID?
  2. Is it possible to recognize movement of the control point (for curve, surface or mesh) and not general modification (translation, rotation and etc)

Thanks,
Dmitriy

Hi @Dmitriy,

How about this:

public static void OnReplaceRhinoObject(object sender, RhinoReplaceObjectEventArgs e)
{
  if (m_my_object_id == e.ObjectId)
  {
    // TODO...
  }
}

This is possible in C++ using a CRhinoOnTransformObject watcher. I don’t believe this is available in RhinoCommon. Why is this important? Is a RhinoDoc.ReplaceRhinoObject event sufficient?

– Dale

Thanks @dale,

For the first one I end up with the same approach.
For second one - I am performing some actions after control points have been modified. So the solution I currently found is to check selected objects in Rhino and verify if selected object type is ObjectType.Grip inside ReplaceRhinoObject watcher.
Another small question - is it allowed to have only one and only instance of EventWatcher?

Thanks,
Dmitriy

Yep. But I’d keep the number to something reasonable…

– Dale