예제 #1
0
        private void AbsCheDimen_Click(object sender, EventArgs e)
        {
            try
            {
                IsAbsCheck       = false;
                AbsCheDimen.Text = "Key Chara.(0)";
                IsRemove         = false;
                RepairDimen.Text = "Remove(0)";

                CaxPublic.SelectObjects(out SelDimensionAry);
                if (SelDimensionAry.Length > 0)
                {
                    IsAbsCheck = true;
                }

                AbsCheDimen.Text = string.Format(@"Key Chara.({0})", SelDimensionAry.Length);

                //foreach (NXObject i in SelDimensionAry)
                //    i.SetAttribute("KC", "KeyChara");

                //MessageBox.Show("指定成功");
            }
            catch (System.Exception ex)
            {
                return;
            }
        }
예제 #2
0
 private void SelDimen_Click(object sender, EventArgs e)
 {
     try
     {
         this.Hide();
         CaxPublic.SelectObjects(out SelDimensionAry);
         this.Show();
         SelDimen.Text = string.Format("選擇物件({0})", SelDimensionAry.Length.ToString());
     }
     catch (System.Exception ex)
     {
         return;
     }
 }
예제 #3
0
 private void SelectObject_Click(object sender, EventArgs e)
 {
     this.Hide();
     NXObject[] SelDimensionAry;
     CaxPublic.SelectObjects(out SelDimensionAry);
     DicSelDimension = new Dictionary <NXObject, string>();
     foreach (NXObject single in SelDimensionAry)
     {
         string DimenType = single.GetType().ToString();
         DicSelDimension.Add(single, DimenType);
     }
     this.Show();
     SelectObject.Text = string.Format("選擇物件({0})", SelDimensionAry.Length.ToString());
 }
예제 #4
0
 private void selDimen_Click(object sender, EventArgs e)
 {
     try
     {
         this.Hide();
         CaxPublic.SelectObjects(out Variables.SelDimensionAry);
         Variables.DicSelDimension = new Dictionary <NXObject, string>();
         foreach (NXObject single in Variables.SelDimensionAry)
         {
             string DimenType = single.GetType().ToString();
             Variables.DicSelDimension.Add(single, DimenType);
         }
         selDimen.Text = string.Format("選擇尺寸({0})", Variables.SelDimensionAry.Length.ToString());
         this.Show();
     }
     catch (System.Exception ex)
     {
         MessageBox.Show("選擇尺寸的對話框載入失敗");
     }
 }
예제 #5
0
        private void RepairDimen_Click(object sender, EventArgs e)
        {
            try
            {
                IsRemove         = false;
                RepairDimen.Text = "Remove(0)";
                IsAbsCheck       = false;
                AbsCheDimen.Text = "Key Chara.(0)";

                CaxPublic.SelectObjects(out SelDimensionAry);
                if (SelDimensionAry.Length > 0)
                {
                    IsRemove        = true;
                    DicSelDimension = new Dictionary <NXObject, string>();
                    foreach (NXObject single in SelDimensionAry)
                    {
                        DicSelDimension.Add(single, single.GetType().ToString());
                    }
                }


                RepairDimen.Text = string.Format(@"Remove({0})", SelDimensionAry.Length);
                //foreach (KeyValuePair<NXObject, string> kvp in DicSelDimension)
                //{
                //    //恢復原始顏色
                //    string oldColor = "";
                //    try
                //    {
                //        //第二次以上指定顏色的話,抓出來的顏色就不是內建顏色EX:125->108->186,抓到的是108
                //        oldColor = kvp.Key.GetStringAttribute(CaxME.DimenAttr.OldColor);
                //        //內建原始顏色
                //        oldColor = "125";
                //    }
                //    catch (System.Exception ex)
                //    {
                //        oldColor = "125";
                //    }
                //    CaxME.SetDimensionColor(kvp.Key, Convert.ToInt32(oldColor));

                //    //取得泡泡資訊
                //    string BallonNum = "";
                //    try
                //    {
                //        BallonNum = kvp.Key.GetStringAttribute(CaxME.DimenAttr.BallonNum);
                //    }
                //    catch (System.Exception ex)
                //    {
                //        BallonNum = "";
                //    }
                //    if (BallonNum != "")
                //    {
                //        CaxME.DeleteBallon(BallonNum);
                //    }

                //    kvp.Key.DeleteAllAttributesByType(NXObject.AttributeType.String);
                //}
                //MessageBox.Show("移除成功");
            }
            catch (System.Exception ex)
            {
                return;
            }
        }