Ghpython + button: how to trigger it only once?

Hi all,

Pushing a button connected to ghpython component will trigger it twice ( true for down; false for up). I want to trigger the script only once and the output should be persistent – not switching to “null” as seen in the screenshot.
Probably this is answered somewhere on the forum but I could not find it.
thanks!!


gh_python_button.gh (4.9 KB)

Here’s a solution that uses a persistent variable to keep track of the last measured timeStamp (i.e. working around the button double trigger concern):


gh_python_button_AHD.gh (2.7 KB)

3 Likes

Works like a charm, thank you

1 Like