Hi everyone
I have a C# component which have several Inputs. One of them is a Numberslider. I want the slider to randomly chose one value when running the code. The change of the number slider modifies a geometry which outputs several points which are then also a input into the C# component.
What I am trying to achieve is that after the number slider changes the value then the code to update the object with the points. Right now it is always the old points which are available for the C#-Component. I tried using ExpireSolution but I think I dont quite understand how to use it.
private void RunScript(bool Run, List<Point3d> Phenotype, double Fitness_Area, double Fitness_Ratio, double Fitness_Boarder, object Genes, int Combinations, ref object A, ref object B)
{
if (Run)
{
var input = Component.Params.Input[5].Sources[0];
var slider = input as Grasshopper.Kernel.Special.GH_NumberSlider;
Random random = new Random();
int permutation = random.Next(1, Combinations);
if (slider != null)
{
slider.SetSliderValue(permutation);
//GrasshopperDocument.ScheduleSolution(10, ScheduleSolutionCallback);
}
A = Phenotype;
B = permutation;
}
}