private void paramInterval(int index, string name, string nickName, string description, GH_ParamAccess access, Interval Value) { if ((Params.Input.Count - 1) < index) { Params.RegisterInputParam(new Param_Interval(), index); Params.OnParametersChanged(); } else { if (Params.Input[index].GetType() != new Param_Interval().GetType()) { Params.Input[index].RemoveAllSources(); Params.Input[index] = new Param_Interval(); Params.OnParametersChanged(); } } Params.Input[index].ClearData(); Param_Interval param = (Param_Interval)Params.Input[index]; param.PersistentData.ClearData(); param.PersistentData.Clear(); param.SetPersistentData(Value); SetParamProperties(index, name, nickName, description, access); }
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ private Param_Interval paramDomain(int index, string Name, string NickName, string Description, Interval Value) { Param_Interval param = (Param_Interval)Params.Input[index]; param.Name = Name; param.NickName = NickName; param.Description = Description; param.PersistentData.Clear(); param.SetPersistentData(Value); return(param); }
IGH_Param IGH_VariableParameterComponent.CreateParameter(GH_ParameterSide side, int index) { String ltr = GH_ComponentParamServer.InventUniqueNickname("ABCDEFGHIJKLMNOPQRSTUVWXYZ", Params.Output); Param_Number param = new Param_Number { NickName = "t" + ltr, Name = "Variable" + ltr, Description = Name, Access = GH_ParamAccess.item }; param.SetPersistentData(0.5); Param_Interval dparam = new Param_Interval { NickName = "d" + ltr, Name = "Domain" + ltr, Description = "Domain of Variable "+ltr, Access = GH_ParamAccess.item }; dparam.SetPersistentData(new GH_Interval(new Interval(0.0,1.0))); Params.RegisterInputParam(dparam, Params.Input.Count); Param_Number oparam = new Param_Number { NickName = ltr, Name = "Variable" + ltr, Description = Name, Access = GH_ParamAccess.item }; Params.RegisterOutputParam(oparam, Params.Input.Count); return param; }