Example #1
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="equMgr"></param>
 /// <param name="equationValue">字典的Value应该为表达式</param>
 /// <remarks>
 /// 全局变量表达式: "B" = 2
 /// 组件表达式:     "N_SPOKES@CirPattern1" = "BARLENGTH@Sketch2" /10
 /// 尺寸表达式       "D1@Extrude2" = (("D1@Extrude3">20, 15, 6))+5
 /// </remarks>
 public static void SetEqu(this EquationMgr equMgr, Dictionary <int, string> equationValue)
 {
     foreach (var item in equationValue)
     {
         var result = equMgr.SetEqu(item.Key, item.Value);
         if (!result)
         {
             throw new Exception("方程式值设置失败," + item.Key + "," + item.Value);
         }
     }
 }
Example #2
0
 /// <summary>
 /// 设置全局变量的值
 /// </summary>
 /// <param name="equMgr"></param>
 /// <param name="equList"></param>
 /// <remarks>
 /// 全局变量表达式: "B" = 2
 /// </remarks>
 public static void SetGlobalEqu(this EquationMgr equMgr, List <swEqu> equList)
 {
     foreach (var item in equList)
     {
         if (item.GlobalVariable)
         {
             var result = equMgr.SetEqu(item.Index, item.Equation);
             if (!result)
             {
                 throw new Exception("方程式值设置失败," + item.Index + "," + item.Value);
             }
         }
     }
 }