algorithmic modeling for Rhino
Hello David / GH Development team,
I just raised this topic on the Rhino Developer forum but am also raising it here because it's clearly a grasshopper topic too. The question is about event handling, in particular, how to best handle multiple 'simultaneous' events when they are triggered and what strategies are recommended.
An example of an event sequence might be this:
A user performs a 'join' on a collection of selected rhino geometry, say 20 objects, which results in the event sequence of an addition of one new object and then the deletion of the 20 previous objects.
My questions has to do with handling these (rhino) events and how they might best fit into the grasshopper solution sequence from a performance point of view.
In the above example what I find is that code which executes perfectly with a small number of events can become quite slow when a significant number of these 'simultanious' events occur.
What strategies are recommended for reducing the above events instead of catching each of them?
One strategy that comes to mind is caching, also found in this example [here], but I'm curious what other strategies might be recommended.
Tags:
This is tricky. Rhino object events are generally useless when it comes to actually responding to them. I've put in a request for a more generic ItsOkToDoStuffNow event, but I don't think they've added one yet. Here's how I handle events in GH:
David,
Dale replied to my enquiry via the Rhino forum. He mentioned the RhinoApp.Idle event which worked well in conjunction with your flagging suggestions.
I agree with you that an ItsOk event would be very useful but it turns out that Idle seems to be a very good substitute.
Welcome to
Grasshopper
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson. Powered by