How can I get a Number Slider object and set a value?

Actually I just realised that’s probably a bad idea (the sliders as inputs). It will expire the solver object whenever the sliders change, so you have to sort of get around that. If the component is inert (like Galapagos) then it doesn’t really matter I suppose.

You won’t need the connectivity diagram for this, you just have to iterate over the source parameters of your input and cast them to GH_NumberSlider.

foreach (IGH_Param param in Params.Input[0].Sources)
{
GH_NumberSlider slider = param as GH_NumberSlider;
if (slider == null)
continue;
// Set the slider.
}

1 Like