privatevoidRunScript(object x, double y, refobject A) { var input = Component.Params.Input[0].Sources[0]; //get the first thing connected to the first input of this component var slider = (Grasshopper.Kernel.Special.GH_NumberSlider) input; //try to cast that thing as a slider
if(slider != null) //if the component was successfully cast as a slider { slider.Slider.Value = (decimal) y; } }
privatevoidRunScript(object x, double y, refobject A) { var input = Component.Params.Input[0].Sources[0]; //get the first thing connected to the first input of this component var slider = (Grasshopper.Kernel.Special.GH_NumberSlider) input; //try to cast that thing as a slider
if(slider != null) //if the component was successfully cast as a slider { if(slider.Slider.Value > (decimal) y / 2){ slider.Slider.Value = (decimal) y / 2; } slider.Slider.Maximum = (decimal) y/2; } }
privatevoidRunScript(object x, object y, double z, refobject A) { var input1 = Component.Params.Input[0].Sources[0]; var slider1 = (Grasshopper.Kernel.Special.GH_NumberSlider) input1;
var input2 = Component.Params.Input[1].Sources[0]; var slider2 = (Grasshopper.Kernel.Special.GH_NumberSlider) input2;
privatevoidRunScript(object x, double y, System.Drawing.Color z, refobject A) { var input = Component.Params.Input[0].Sources[0]; //get the first thing connected to the first input of this component var slider = (Grasshopper.Kernel.Special.GH_NumberSlider) input; //try to cast that thing as a slider
if(slider != null) //if the component was successfully cast as a slider { slider.Slider.DrawControlBackground = true; slider.Slider.DrawControlBorder = true; slider.Slider.ControlEdgeColour = Color.Blue; slider.Slider.ControlBackColour = z; } }