I’ve been playing around with event handling in python, trying to follow the best practice of setting flags (using scriptcontext.sticky) and then doing as much as possible when Rhino is idle, but it seemed like the Idle event was never firing.
So I tried to find a basic working example of the Idle event and came across clement’s example from this post. On my machine, this code works in Rhino 5, but not in Rhino 6. It’s not clear to me from the documentation why that is, but then again I’m just starting to delve into event handling in .NET.
Any ideas as to why the example does not work in Rhino 6?
the linked script seems to work over here using Rhino 6 SR28 (6.28.20199.17141, 17.07.2020) under Windows. I can see clock running in the statusbar once started:
Fired up a new instance of Rhino to check and… it works now… as does the other code I was trying to use earlier… which I suppose means in my earlier instance, something got broken while I was messing around with my code. Maybe something to do with the sticky, maybe something to do with events not being properly shut down.
whoops.
If that is the case, would it be more robust to work with events in a C# plugin than a python script? Or are these just issues that one always has to deal with when working with events?
In any case I appreciate the help, as well as the example script