algorithmic modeling for Rhino
I'm looking for the possibilities of Python with running simulations within Grasshopper. I'm familiar with running these in VB.net, meaning Dim a variable in the secondary part of the script, so that it updates this global variable every time the script refreshes and connect a timer to the component to get the simulation running. (I added a small definition to illustrate what I mean)
My question is if anyone is familiar or has some thoughts about this within the GH_Python component? I guess it has to do with how the component updates and completely reads the script every time it updates, right?
I guess another result of this way of updating is that the Python component seems to work significantly slower then the VB.net component, for as it has to import it's full classes with every refresh. Maybe something for on the wishlist? I don't know if it is so easy to change this?
Any help or experience with this?
Thank you very much!
There is a sticky dictionary inside the scriptcontext module that you can use for that.
I hope it will help,
Thanks for the quick reply!
I checked that and it looks promising! I'll start playing around with the sticky dictionary.
Thanks for your reply. It really helps me a lot.
Do you dimension things only in the second line when you want them to be persistent data?
I am not so sure about this question... can you elaborate on it a little bit? (maybe opening a new thread could be useful).