Execute a treatment only once, and store the results

Hello,

Is it possible to evaluate a component only at some condition ?

For example I want the VB component to be evaluated only if x (EDIT : the value of the Toggle) is True :

JL

evaluation.gh (4.3 KB)

If statement:

https://docs.microsoft.com/de-de/dotnet/visual-basic/language-reference/statements/if-then-else-statement

No. The component will always be evaluated, even if i put an If statement in it.

Same thing with Metahopper OnOff function

Just a thought that you may be able to achieve this using dispatch component.

It will always be called if there’s data going in. But you can return immediately if the inputs aren’t to your liking.

Well, my need was to execute a treatment only once, and keep the results.

I found a solution using Metahopper components.

But i get an annoying “GH Breakpoint” error message : “object expired during a solution”.

JL

only once.gh (17.6 KB)

New version, simplier and without GH error message.

only once.gh (13.6 KB)