Subscribing to an object?


(Tom D.) #1

Hello all,
I’m playing around with a small utility plugin (RhinoCommon, C#, Windows) and wanted to know the following: is it possible (and relatively easy), to be informed of when a specific object has been modified in any way? I would like to create a small assistant that gives me some feedback on the state of a user-selected object so I can have a chance to enforce some rules on the geometry of the object… Any pointers?
Best,
Tom


(Dale Fugier) #2

Hi @piroshki,

There are several events on RhinoDoc that you can subscribe to. Of these, RhinoDoc.ReplaceRhinoObject and RhinoDoc.ModifyObjectAttributes are worth watching. There may be others too.

The SDK samples include one that exercises a number of events. You might want to clone the repo, build, and test.

https://github.com/mcneel/rhino-developer-samples/tree/6/rhinocommon/cs/SampleCsEventWatcher

Here is the repo:

https://github.com/mcneel/rhino-developer-samples

– Dale


(Tom D.) #3

Fantastic - thank you for the pointer Dale - much appreciated.

Tom