BeforeTransformObjects Event

Hi @dale,

i am trying to get the objects which are transformed using an BeforeTransformObjects Event handler in Rhino 5 SR12. Below code toggles the event handler:

import Rhino
import scriptcontext

def MyTransformEvent(sender, e):
    print e.Objects

def DoSomething():
    key = "MyTransformEvent"
    if scriptcontext.sticky.has_key(key):
        print "Event DISABLED"
        scriptcontext.doc.BeforeTransformObjects -= scriptcontext.sticky[key]
        scriptcontext.sticky.Remove(key)
    else:
        print "EVENT ENABLED"
        scriptcontext.sticky[key] = eval(key)
        scriptcontext.doc.BeforeTransformObjects += eval(key)

if __name__=="__main__":
    DoSomething()

While the event is enabled, in Rhino 5 SR 12 the MyTransformEvent function always returns None for the objects beeing transformed while in Rhino 6 WIP, i get this result, eg. when a single point is transformed:

Array[RhinoObject]((<Rhino.DocObjects.PointObject object at 0x000000000000002E [ModelGeometry: (unnamed) (0)]>))

Is there anything i can do to make it work in Rhino 5 and get the objects beeing transformed ?

c.

It might be possible to iterate the document looking for selected objects. But that is the only potential solution, I believe…

– Dale

@dale, thanks that is what i did in the hope the objects are the same.

I’ll do some filtering for unwanted objects anyway :wink:

c.