Tracking Transforms (BeforeTransformObjects Event)

I would like to track all the transformations which occur to certain objects in Rhino from import to purge.

I discovered that a python script which calls rhinoscriptsyntax.MoveObjects(object_ids, translation) produces events:
ReplaceRhinoObject
DeleteRhinoObject
AddRhinoObject

but no BeforeTransformObjects event.

Is this intended behavior and are there other situations in which objects are transformed but do not produce this event?

Thank you.

Is the method RhinoObject.OnTransform(Transform transform) also only called or triggered by commands that inherit from TransformCommand?

Hi @jakemurphy0118,

Yes, I believe this is the case.

Commands that inherit from TransformCommand include Move, Copy, Scale, etc.

– Dale

I discovered that RhinoObject.OnTransform is called following a call to rhinoscriptsyntax.MoveObjects while BeforeTransformObjects does not fire. I’ve attached a plugin and script to help demonstrate this.
TrackingTransforms.zip (35.0 KB)
centerObject.py (569 Bytes)

I might be able to use the custom object method to track transformations; however, this feels inconsistent and not what you would expect based on the RhinoDoc events.

Edit:
Yes, you can do this with CustomObjects. Instead of performing accounting of transforms in BeforeTransformObjects handlers, perform the accounting in the custom object’s OnTransform overridden method.