Execute a treatment only once, and store the results

#1

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)

(Tim Stark) #2

If statement:

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

#3

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

#4

Same thing with Metahopper OnOff function

#5

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

(David Rutten) #6

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

#7

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)

#8

New version, simplier and without GH error message.

only once.gh (13.6 KB)