What's in "trigger"(in Util,GH)?

Hi guys,
I want to find the trigger component in C# script(Visual Studio) to recalculate some other conponents,but I can’t find it.It doesn’t look like it’s in “Grasshopper.Kernel.Special”.

Should I use “ExpireSolution” , “ClearData” , “ComputeData” or something else?But I don’t know which function I should write them into and when to call them.

Seems like “ExpireSolution” is not a good idea?([Confusion with ExpireSolution()])

Actually,I want to build a circulation below:


A and B are two components.When B finishes calculation, a variable in static class C will change.D always listen to C and D will inform A to recalculate after C changes.So I want to have a trigger to control recalculation of A.

Please help me,thank you so much.

I believe it uses ScheduleSolution.

Inside the callback function you could:

  • check if trigger is still active, and return immediately if not
  • else call ExpireSolution(false) for the triggered component
  • and finally schedule the next solution

Thanks a lot.It’s helpful.

I solved the problem with following steps:

  • Combine component C and D.
  • Put an event in C and make A register it at the beginning.A has a ScheduleSolution() function with ExpireSolution() in it.
  • When the variable of C changes,the event invokes.