Esempio n. 1
0
 //------------------------------------------------------------------------------
 //Callback Name: update_cb
 //------------------------------------------------------------------------------
 public int update_cb(NXOpen.BlockStyler.UIBlock block)
 {
     try
     {
         if (block == strType1)
         {
             //---------Enter your code here-----------
             SetImage();
         }
         else if (block == png)
         {
             //---------Enter your code here-----------
         }
         else if (block == bodySelectA)
         {
             //---------Enter your code here-----------
         }
         else if (block == label0)
         {
             //---------Enter your code here-----------
         }
         else if (block == bodySelectB)
         {
             //---------Enter your code here-----------
         }
         else if (block == label01)
         {
             //---------Enter your code here-----------
         }
         else if (block == buttonOk)
         {
             //---------Enter your code here-----------
             this.standard.Clear();
             this.infos.Clear();
             DeleteAllNode();
             Body         aBody = bodySelectA.GetSelectedObjects()[0] as Body;
             Body         bBody = bodySelectB.GetSelectedObjects()[0] as Body;
             AnalysisMold ana   = new AnalysisMold(aBody, bBody);
             if (this.strType1.WideValue.Contains("细水口"))
             {
                 baseName = new PinPointGateSystem(ana);
             }
             else if (this.strType1.WideValue.Contains("大水口"))
             {
                 baseName = new EdgeGateSystem(ana);
             }
             else
             {
                 baseName = new EdgeGateSystem(ana);
             }
             SetTreeInfo();
         }
         else if (block == stringName)
         {
             //---------Enter your code here-----------
         }
         else if (block == seleBody)
         {
             //---------Enter your code here-----------
             if (seleBody.GetSelectedObjects().Length > 0)
             {
                 buttonOk1.Enable = true;
             }
         }
         else if (block == buttonOk1)
         {
             //---------Enter your code here-----------
             if (seleBody.GetSelectedObjects().Length > 0)
             {
                 this.standard.Clear();
                 this.infos.Clear();
                 DeleteAllNode();
                 baseName.AddMoldBody(seleBody.GetSelectedObjects()[0] as Body, this.stringName.WideValue);
                 SetTreeInfo();
                 // seleBody.SetSelectedObjects(null);
             }
         }
         else if (block == strType)
         {
             //---------Enter your code here-----------
             SetMaceMessge();
         }
         else if (block == mulMessage)
         {
             //---------Enter your code here-----------
         }
     }
     catch (Exception ex)
     {
         //---- Enter your exception handling code here -----
         theUI.NXMessageBox.Show("Block Styler", NXMessageBox.DialogType.Error, ex.ToString());
     }
     return(0);
 }