Exemple #1
0
    //------------------------------------------------------------------------------
    //  Explicit Activation
    //      This entry point is used to activate the application explicitly
    //------------------------------------------------------------------------------
    public static int Main(string[] args)
    {
        int retValue = 0;

        try
        {
            theProgram = new Program();

            //TODO: Add your application code here

            bool status;

            #region 檢查METEDownload_Upload.dat是否存在

            /*
             * status = CaxCheckDat.CheckMETEDownload_Upload();
             * if (!status)
             * {
             *  MessageBox.Show("METEDownload_Upload.dat不存在");
             *  return retValue;
             * }
             */
            #endregion

            #region 關閉 Preferences->Manufacturing->Operation->Regresh before Each Path

            //NXOpen.CAM.Preferences preferences1;
            //preferences1 = theSession.CAMSession.CreateCamPreferences();
            //preferences1.ReplayRefreshBeforeEachPath = false;
            //preferences1.Commit();
            //preferences1.Destroy();

            #endregion

            Application.EnableVisualStyles();
            ExportShopDocDlg cExportShopDocDlg = new ExportShopDocDlg();
            FormUtilities.ReparentForm(cExportShopDocDlg);
            System.Windows.Forms.Application.Run(cExportShopDocDlg);
            cExportShopDocDlg.Dispose();

            //cExportShopDocDlg.ShowDialog();

            theProgram.Dispose();
        }
        catch (NXOpen.NXException ex)
        {
            // ---- Enter your exception handling code here -----
        }
        return(retValue);
    }
Exemple #2
0
    //------------------------------------------------------------------------------
    //  Explicit Activation
    //      This entry point is used to activate the application explicitly
    //------------------------------------------------------------------------------
    public static int Main(string[] args)
    {
        int retValue = 0;

        try
        {
            theProgram = new Program();

            //TODO: Add your application code here

            bool status;
            //StreamReader _read = new StreamReader(string.Format(@"D:\O5566"));
            //string getStr = _read.ReadToEnd();
            //MessageBox.Show(Encoding.UTF8.GetByteCount(getStr).ToString());

            //return 0;
            #region 檢查METEDownload_Upload.dat是否存在

            /*
             * status = CaxCheckDat.CheckMETEDownload_Upload();
             * if (!status)
             * {
             *  MessageBox.Show("METEDownload_Upload.dat不存在");
             *  return retValue;
             * }
             */
            #endregion

            #region 關閉 Preferences->Manufacturing->Operation->Regresh before Each Path

            //NXOpen.CAM.Preferences preferences1;
            //preferences1 = theSession.CAMSession.CreateCamPreferences();
            //preferences1.ReplayRefreshBeforeEachPath = false;
            //preferences1.Commit();
            //preferences1.Destroy();

            #endregion

            int module_id;
            theUfSession.UF.AskApplicationModule(out module_id);
            if (module_id != UFConstants.UF_APP_CAM)
            {
                MessageBox.Show("請先轉換為加工模組後再執行!");
                return(retValue);
            }

            Application.EnableVisualStyles();
            ExportShopDocDlg cExportShopDocDlg = new ExportShopDocDlg();
            FormUtilities.ReparentForm(cExportShopDocDlg);
            System.Windows.Forms.Application.Run(cExportShopDocDlg);
            cExportShopDocDlg.Dispose();

            //cExportShopDocDlg.ShowDialog();

            theProgram.Dispose();
        }
        catch (NXOpen.NXException ex)
        {
            // ---- Enter your exception handling code here -----
        }
        return(retValue);
    }