algorithmic modeling for Rhino
From my understanding a Grasshopper component is executed every time that its inputs are changed.
I want to be able to count the number of times that a component has been executed using sticky, but I'm un-sure how to do it could anyone please give me some sample code in Python?
Thank you!
Tags:
This thread has a couple of approaches to this. I'm sure there probably are properties of the GHPython component itself which keeps track of how many times it has been executed etc. If so you can access it via ghenv.Component inside the GHPython code..
That just requires a static integer that you increment at the start of your main def. I'm sorry but I don't know how to declare a static variable in Python.
David I believe I found the answer in this GH file for future reference Ive attached it here
You could also do it with a static integer the approach below uses the sticky
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
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson. Powered by