@kike I’m puzzled right now, my script seems to be OK, but for some reason when I input a True Value for the Content Cache action, it runs twice. When I press the button on the component itself, it works as expected.
Thing is, for some reason, the script enters a state where it keeps pushing data to Rhino.
This is on (8.17.25066.7001, 2025-03-07).
This works the same for the script I work on, but when I have everything referenced and recomputing it creates a loop. I suspect this is due to the action input misbehaving, because it doesn’t happen with the component button itself.
Windows 10 (10.0.19045 SR0.0) or greater (Physical RAM: 32GB)
.NET 7.0.0
Computer platform: LAPTOP - Plugged in [100% battery remaining]
Non-hybrid graphics configuration.
Primary display and OpenGL: NVIDIA GeForce GTX 1070 (NVidia) Memory: 8GB, Driver date: 12-6-2021 (M-D-Y). OpenGL Ver: 4.6.0 NVIDIA 472.84
> Integrated accelerated graphics device with 4 adapter port(s)
- Windows Main Display is laptop’s integrated screen or built-in port
Primary OpenGL: NVIDIA GeForce GTX 1070 (NVidia) Memory: 8GB, Driver date: 12-6-2021 (M-D-Y). OpenGL Ver: 4.6.0 NVIDIA 472.84
> Integrated accelerated graphics device with 4 adapter port(s)
- Windows Main Display is laptop’s integrated screen or built-in port
OpenGL Settings
Safe mode: Off
Use accelerated hardware modes: On
GPU Tessellation is: On
Redraw scene when viewports are exposed: On
Graphics level being used: OpenGL 4.6 (primary GPU’s maximum)
Anti-alias mode: 4x
Mip Map Filtering: Linear
Anisotropic Filtering Mode: High
Vendor Name: NVIDIA Corporation
Render version: 4.6
Shading Language: 4.60 NVIDIA
Driver Date: 12-6-2021
Driver Version: 30.0.14.7284
Maximum Texture size: 32768 x 32768
Z-Buffer depth: 24 bits
Maximum Viewport size: 32768 x 32768
Total Video Memory: 8 GB
The button is triggering a True and when you release the mouse button a False.
But if you change the normal state to be also True it will not expire again the solution.
Hi @kike,
I had tried a null before, that didn’t do the trick yet. With True on normal state, it just keeps running. Same applies when I feed in a condition that is True (e.g. I overwrote a dimension text to move the line with).
For convenience I’ve added lines to denote the offset steps of 400mm, which is the amount that each push should move the line. So you can see that the movement is two steps at once (800mm) with the normal state set to Test (Null). Dimension push.3dm (61.2 KB) Dimension Push.gh (21.0 KB)
To be clear, this is with both states set to True:
The script moves by 800mm, whereas the undos correctly capture the 400mm movement.
Same with the True only button from the thread @Japhy linked:
If I remember correctly the Pancake plugin contains a few very helpful nodes in cases like these. I too had issues with very long scripts sometimes calculating twice. It’s a shame Grasshopper isn’t really designed to handle any sort of reactive programming.
Unfortunalely, none of these components help me solve the root issue, but they are definitely useful. Hadn’t really used any of them thusfar, but will do so sooner or later.
Okay. I have used the True only button a lot in my scripts where I am triggering loops and such. I also find that you can usually create a quick C# component for what you need if you can explain it well to ChatGPT and the like. Just create a C# component, copy all the code that is already there as a template and give it to ChatGPT with a prompt explaining your problem. You could just copy/paste your initial post.
Also I find Heteroptera has a lot of interesting components that sometimes help achieve something otherwise tricky. Of course Metahopper is one I often use as a sort of last resort, for example to just disable or expire a component programmatically.