Ejemplo n.º 1
0
        public void ParametersModified(GH_VarParamSide side)
        {
            switch (side)
            {
            case GH_VarParamSide.Input:
                foreach (var i in Params.Input)
                {
                    if (i is Param_ScriptVariable)
                    {
                        FixGhInput(i as Param_ScriptVariable);
                    }
                }
                break;

            case GH_VarParamSide.Output:
                foreach (var i in Params.Input)
                {
                    if (i is Param_GenericObject)
                    {
                        i.Name        = i.NickName;
                        i.Description = i.NickName;
                    }
                }
                break;
            }
        }
Ejemplo n.º 2
0
 IGH_Param ConstructVariable(GH_VarParamSide side, string nickname)
 {
     if (side == GH_VarParamSide.Input)
     {
         var param = new Param_ScriptVariable();
         if (!string.IsNullOrWhiteSpace(nickname))
         {
             param.NickName = nickname;
         }
         FixGhInput(param);
         return(param);
     }
     if (side == GH_VarParamSide.Output)
     {
         var param = new Param_GenericObject();
         if (string.IsNullOrWhiteSpace(nickname))
         {
             param.Name = param.NickName;
         }
         else
         {
             param.NickName = nickname;
             param.Name     = String.Format("Result {0}", nickname);
         }
         param.Description = String.Format("Output parameter {0}", param.NickName);
         return(param);
     }
     return(null);
 }
Ejemplo n.º 3
0
 IGH_Param ConstructVariable(GH_VarParamSide side, string nickname)
 {
     if (side == GH_VarParamSide.Input)
       {
     var param = new Param_ScriptVariable();
     if (!string.IsNullOrWhiteSpace(nickname))
       param.NickName = nickname;
     FixGhInput(param);
     return param;
       }
       if (side == GH_VarParamSide.Output)
       {
     var param = new Param_GenericObject();
     if (string.IsNullOrWhiteSpace(nickname))
       param.Name = param.NickName;
     else
     {
       param.NickName = nickname;
       param.Name = String.Format("Result {0}", nickname);
     }
     param.Description = String.Format("Output parameter {0}", param.NickName);
     return param;
       }
       return null;
 }
Ejemplo n.º 4
0
        public void ParametersModified(GH_VarParamSide side)
        {
            switch (side)
              {
            case GH_VarParamSide.Input:
              foreach (var i in Params.Input)
              {
            if (i is Param_ScriptVariable)
              FixGhInput(i as Param_ScriptVariable);
              }
              break;

            case GH_VarParamSide.Output:
              foreach (var i in Params.Input)
              {
            if (i is Param_GenericObject)
            {
              i.Name = i.NickName;
              i.Description = i.NickName;
            }
              }
              break;
              }
        }
Ejemplo n.º 5
0
 public void ManagerConstructed(GH_VarParamSide side, Grasshopper.GUI.GH_VariableParameterManager manager)
 {
     string pool = (side == GH_VarParamSide.Input) ? "xyzuvw" : "abcdef";
       manager.NameConstructor = new GH_CharPatternParamNameConstructor(pool, 4);
 }
Ejemplo n.º 6
0
        public void ManagerConstructed(GH_VarParamSide side, Grasshopper.GUI.GH_VariableParameterManager manager)
        {
            string pool = (side == GH_VarParamSide.Input) ? "xyzuvw" : "abcdef";

            manager.NameConstructor = new Grasshopper.Kernel.GH_StringPattern(pool, 4);
        }