What is the best practice to check for model changes?

Hello!

I am constructing a plugin where we have a UserData defined and these objects should be specific, imagine a brep. If changed, I need to check if the brep is still valid, for example if the user uses the Explode command on it, it does influence some other things in my code, hence i wanne then do some adjustments or fixes or prevent the explode for example, or just remove it from my internal structure.

What is the best way to approach this? I prefereably want to know via an event, the specific object that changed, and maybe how it changed in order to compare it and check the validity based on my standards.

Any ideas?

did you see this sample:

          RhinoDoc.AddRhinoObject += OnAddRhinoObject;
          RhinoDoc.ReplaceRhinoObject += OnReplaceRhinoObject;
          RhinoDoc.DeleteRhinoObject += OnDeleteRhinoObject;
          RhinoDoc.UndeleteRhinoObject += OnUndeleteRhinoObject;
          RhinoDoc.PurgeRhinoObject += OnPurgeRhinoObject;
          RhinoDoc.ModifyObjectAttributes += OnModifyObjectAttributes;
          RhinoDoc.BeforeTransformObjects += OnBeforeTransformObjects;

          RhinoDoc.SelectObjects += OnSelectObjects;
          RhinoDoc.DeselectObjects += OnDeselectObjects;
          RhinoDoc.DeselectAllObjects += OnDeselectAllObjects;

hope above helps - kind regards -tom

1 Like

Hi @Benterich,

Something else worth considering.

https://developer.rhino3d.com/api/rhinocommon/rhino.geometry.geometrybase/datacrc

– Dale

1 Like

Thanks for the great input! I am just finishing up another feature and then i am gonna tackle this! I keep you updated here! :student: