algorithmic modeling for Rhino
Hi,
I've really run aground on this (seemingly very simple) problem.
I am trying to set up a boolean switch, that once a certain threshold is passed the switch is tripped, but inside that threshold the value is maintained.
I have a value changing with time, moving between 1 and 100.
If x<25, then True
If x>75, then False
If 25<x<75, make no change to the previous value
It's the last line that's really doing my head in
Thanks in advance for your help
m
Tags:
Hey Matt,
I would recommend the python sticky module. It is an external memory that keeps track of values even after an iteration of GH ended, so you always know the status of your switch at the iteration before the current one.
Best,
Dominik
Thanks so much to both of you. It's working great.
If I wanted to use different 'mySticky' values in different places around a single definition, how would I do that?
Is it as simple as specifying 'mySticky_02' etc. for the other values?
Yes, that simple.
Basically it is a globally accessible variable system. You can exchange values even between different GH-definitions. I think the sticky values stay in memory for Rhino runtime.
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