Beispiel #1
0
 /// <summary>
 /// 刪除指定的泡泡
 /// </summary>
 /// <param name="BallonNum"></param>
 /// <returns></returns>
 public static bool DeleteBallon(string BallonNum)
 {
     try
     {
         IdSymbolCollection aa = workPart.Annotations.IdSymbols;
         IdSymbol[]         bb = aa.ToArray();
         foreach (NXOpen.Annotations.IdSymbol i in bb)
         {
             NXOpen.Annotations.IdSymbolBuilder idSymbolBuilder1;
             idSymbolBuilder1 = workPart.Annotations.IdSymbols.CreateIdSymbolBuilder(i);
             string a = idSymbolBuilder1.UpperText;
             idSymbolBuilder1.Destroy();
             a = a.Remove(0, 6);
             a = a.Remove(1, 3);
             if (BallonNum == a)
             {
                 //NXObject[] objects1 = new NXObject[1];
                 //objects1[0] = i;
                 //theSession.UpdateManager.AddToDeleteList(objects1);
                 CaxPublic.DelectObject(i);
             }
         }
     }
     catch (System.Exception ex)
     {
         return(false);
     }
     return(true);
 }
        private static bool ReadDownUpLoadDat(string jsonPath, out DownUpLoadDat sDownUpLoadDat)
        {
            sDownUpLoadDat = new DownUpLoadDat();

            try
            {
                if (!System.IO.File.Exists(jsonPath))
                {
                    return(false);
                }

                bool status;

                string jsonText;
                status = CaxPublic.ReadFileDataUTF8(jsonPath, out jsonText);
                if (!status)
                {
                    return(false);
                }

                sDownUpLoadDat = JsonConvert.DeserializeObject <DownUpLoadDat>(jsonText);
            }
            catch (System.Exception ex)
            {
                return(false);
            }

            return(true);
        }
        public static bool ReadDraftingConfig(string jsonPath, out DraftingConfig cDraftingConfig)
        {
            cDraftingConfig = new DraftingConfig();
            try
            {
                if (!System.IO.File.Exists(jsonPath))
                {
                    return(false);
                }

                bool status;

                string jsonText;
                status = CaxPublic.ReadFileDataUTF8(jsonPath, out jsonText);
                if (!status)
                {
                    return(false);
                }

                cDraftingConfig = JsonConvert.DeserializeObject <DraftingConfig>(jsonText);
            }
            catch (System.Exception ex)
            {
                return(false);
            }
            return(true);
        }
Beispiel #4
0
 /// <summary>
 /// 取得METEDownloadData.dat資料
 /// </summary>
 /// <param name="cMETEDownloadData"></param>
 /// <returns></returns>
 public static bool GetMETEDownloadData(out METEDownloadData cMETEDownloadData)
 {
     cMETEDownloadData = new METEDownloadData();
     try
     {
         string METEDownloadDat_dat = "METEDownloadData.dat";
         string METEDownloadDatPath = string.Format(@"{0}\{1}", CaxEnv.GetGlobaltekTaskDir(), METEDownloadDat_dat);
         CaxPublic.ReadMETEDownloadData(METEDownloadDatPath, out cMETEDownloadData);
     }
     catch (System.Exception ex)
     {
         return(false);
     }
     return(true);
 }
Beispiel #5
0
 /// <summary>
 /// 取得METEDownload_Upload.dat資料
 /// </summary>
 /// <param name="cMETE_Download_Upload_Path"></param>
 /// <returns></returns>
 public static bool GetMETEDownload_Upload(out METE_Download_Upload_Path cMETE_Download_Upload_Path)
 {
     cMETE_Download_Upload_Path = new METE_Download_Upload_Path();
     try
     {
         string METEDownload_Upload_dat  = "METEDownload_Upload.dat";
         string METEDownload_Upload_Path = string.Format(@"{0}\{1}", CaxEnv.GetGlobaltekEnvDir(), METEDownload_Upload_dat);
         CaxPublic.ReadMETEDownloadUpload_Path(METEDownload_Upload_Path, out cMETE_Download_Upload_Path);
     }
     catch (System.Exception ex)
     {
         return(false);
     }
     return(true);
 }
Beispiel #6
0
        /// <summary>
        /// 取得ControlerConfig.dat資料  (路徑:IP:Globaltek\TE_Config\ControlerConfig.dat)
        /// </summary>
        /// <param name="cControlerConfig"></param>
        /// <returns></returns>
        public static bool GetControlerConfigData(out ControlerConfig cControlerConfig)
        {
            cControlerConfig = new ControlerConfig();
            try
            {
                string ControlerConfig_dat  = "ControlerConfig.dat";
                string ControlerConfig_Path = string.Format(@"{0}\{1}\{2}\{3}", CaxEnv.GetGlobaltekEnvDir(), "TE_Config", "Config", ControlerConfig_dat);
                if (!System.IO.File.Exists(ControlerConfig_Path))
                {
                    MessageBox.Show("路徑:" + ControlerConfig_Path + "不存在");
                    return(false);
                }

                CaxPublic.ReadControlerConfig(ControlerConfig_Path, out cControlerConfig);
            }
            catch (System.Exception ex)
            {
                return(false);
            }
            return(true);
        }
Beispiel #7
0
        /// <summary>
        /// 取得圖紙區域資料
        /// </summary>
        /// <param name="cCoordinateData"></param>
        /// <returns></returns>
        public static bool GetDraftingCoordinateData(out CoordinateData cCoordinateData)
        {
            cCoordinateData = new CoordinateData();
            try
            {
                string DraftingCoordinate_dat  = "DraftingCoordinate.dat";
                string DraftingCoordinate_Path = string.Format(@"{0}\{1}\{2}\{3}", CaxEnv.GetGlobaltekEnvDir(), "ME_Config", "Config", DraftingCoordinate_dat);
                if (!System.IO.File.Exists(DraftingCoordinate_Path))
                {
                    MessageBox.Show("路徑:" + DraftingCoordinate_Path + "不存在");
                    return(false);
                }

                CaxPublic.ReadCoordinateData(DraftingCoordinate_Path, out cCoordinateData);
            }
            catch (System.Exception ex)
            {
                return(false);
            }
            return(true);
        }