FixValue is not the right method to call, that method merely fixes the assigned value (i.e. it makes sure it doesn’t exceed the limits and adheres to the correct rounding scheme).
The problem you have is actually three-fold:
- Get references to all sliders you want to change.
- Change all slider values.
- Run a new solution.
I don’t know how you define which sliders are relevant to you, so I cannot much comment yet on item #1.
There are four ways in which you can change the slider value, you’ll have to decide which is best for you:
- Through the Grasshopper.Kernel.Special.GH_NumberSlider.TickValue property
- Through the Grasshopper.Kernel.Special.GH_NumberSlider.SetSliderValue() method
- Through the Grasshopper.Kernel.Special.GH_NumberSlider.TrySetSliderValue() method
- By accessing the underlying slider object via GH_NumberSlider.Slider (not recommended).
Galapagos uses the first approach, because it is the simplest and only involves integer arithmetic (Galapagos avoids floating point numbers whenever possible). The TickCount and TickValue properties available on every GH_NumberSlider object tell you how many unique states the slider supports and which is the current state. For example an integer slider from -5 to +5 supports 11 unique states {-5,-4,-3,-2,-1,0,1,2,3,4,5} so you can set the slider to any state between and including 0 to 10.
SetSliderValue() and TrySetSliderValue() are similar, but they assign floating point values to the slider instead. The value you assign is not guaranteed to be the value you end up with, as it is subject to limits and rounding. The difference between SetSliderValue() and TrySetSliderValue() is only relevant if the slider has an internal expression which modifies the ultimate slider value. TrySetXXX will attempt to backsolve the expression so that the ultimate value best resembles the value you requested, whereas SetXXX just sets the slider value prior to the expression.
By accessing the underlying slider object you get access to all slider properties, but it is not exactly trivial to make sure the slider ends up in a valid state if you start poking those.
Ultimately after you’ve set all values, you’ll have to trigger a new solution. You can do so by calling NewSolution(false) on the GH_Document which contains the sliders.