Note that using a non-unique sticky
key (i.e. "x"
) means that another instance of this GHPython component (or anything else that can access the sticky
) can mess with this sticky
value (leading to all sorts of potential trouble). A couple of ways around this:
-
Get the
guid
of the GHPython component and append this to the key (example here), making the key value unique to the specific GHPython component instance (meaning you can copy/paste it). -
Or better yet: Use the
if “foo” not in globals()
method for creating a persistent variable (covered here and here).