I have a large Grasshopper program with many Python code blocks.
Is it possible to define global scope constants accessible to all Python code blocks?
I have a large Grasshopper program with many Python code blocks.
Is it possible to define global scope constants accessible to all Python code blocks?
Put them in the sticky
dictionary (that can be accessed across all GHPython components and the Rhino Python editor within the same Rhino instance).
Thank you!
I tried to use this approach to prevent my Grasshoper file looking spaghetti from wiring the same variables all around. When I change one of those variables, this doesnât update the âoutputâ script:
which is very unfortunate.
The issue there Gui is that there is nothing to tell the other component that it has expired.
You will need to do that manually in the first component. It is probably easier to use âghenv.Component.blahâ in the second component to get some ID information to hard code into the first.
If you ask me, wires are good. They indicate a connection in between components, and they define a strict order of computation. What you probably donât want is a wire for each parameter. In order to prevent that issue, just put variables in a single anonymous type, such as a tuple, and pass them in one go from one component to another.