Example #1
0
        public void Create(bool res, params double[] list)
        {
            KompasApp app = new KompasApp();

            app.GetActiveApp();
            if (app.Kompas == null)
            {
                app.NewApp();
            }
            Parameter[] param = new Parameter[list.Length];
            for (int i = 0; i < list.Length; i++)
            {
                param[i].Value = list[i];
            }
            param[0].Descrpiption = PluginForKompas.Properties.Resources.HexagonDepth;
            param[1].Descrpiption = PluginForKompas.Properties.Resources.StiffenerDepth;
            param[2].Descrpiption = PluginForKompas.Properties.Resources.StiffenerWidth;
            param[3].Descrpiption = PluginForKompas.Properties.Resources.HexagonDiameter;
            param[4].Descrpiption = PluginForKompas.Properties.Resources.CircumentalHoles;
            param[5].Descrpiption = PluginForKompas.Properties.Resources.CenterHole;
            param[6].Descrpiption = PluginForKompas.Properties.Resources.Rigidity;
            param[7].Descrpiption = PluginForKompas.Properties.Resources.Count;

            GearBuilder Gear = new GearBuilder(app, param);

            Assert.AreEqual(res, Gear.CreateGear());
        }
Example #2
0
 /// <summary>
 /// Создать новую деталь
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void buildButton_Click(object sender, EventArgs e)
 {
     Parameter[] param = new Parameter[0];
     param = ReadData();
     if (param != null)
     {
         try
         {
             GearBuilder Gear = new GearBuilder(app, param);
             Gear.CreateGear();
         }
         catch
         {
             MessageBox.Show("Object wasn't created.");
         }
     }
 }