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

            MEOpenTaskDlg cMEOpenTaskDlg = new MEOpenTaskDlg();
            cMEOpenTaskDlg.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;

            #region 判斷METEDownload_Upload.dat是否存在

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

            #endregion


            string AsmPartName = "";
            try
            {
                Part displayPart = theSession.Parts.Display;
                AsmPartName = displayPart.FullPath;
            }
            catch (System.Exception ex)
            {
                AsmPartName = "";
            }

            if (AsmPartName != "")
            {
                MessageBox.Show("請先關閉檔案再使用該功能!");
            }
            else
            {
                Application.EnableVisualStyles();
                TEOpenTaskDlg cTEOpenTaskDlg = new TEOpenTaskDlg();
                FormUtilities.ReparentForm(cTEOpenTaskDlg);
                System.Windows.Forms.Application.Run(cTEOpenTaskDlg);
                cTEOpenTaskDlg.Dispose();
            }
            theProgram.Dispose();
        }
        catch (NXOpen.NXException ex)
        {
            // ---- Enter your exception handling code here -----
        }
        return(retValue);
    }
Exemple #3
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;


            //取得CustomerName配置檔
            //string CustomerName_dat = "CustomerName.dat";
            //string CustomerNameDatPath = string.Format(@"{0}\{1}", CaxPE.GetPEConfigDir(), CustomerName_dat);
            status = CaxCheckDat.CheckCustomerName();
            if (!status)
            {
                MessageBox.Show("取得CustomerNameDatPath失敗");
                return(retValue);
            }

            //取得OperationArray配置檔
            //string OperationArray_dat = "OperationArray.dat";
            //string OperationArrayDatPath = string.Format(@"{0}\{1}", CaxPE.GetPEConfigDir(), OperationArray_dat);
            status = CaxCheckDat.CheckOperationArray();
            if (!status)
            {
                MessageBox.Show("取得OperationArrayDatPath失敗");
                return(retValue);
            }

            Application.EnableVisualStyles();
            PEGenerateDlg cPEGenerateDlg = new PEGenerateDlg();
            FormUtilities.ReparentForm(cPEGenerateDlg);
            System.Windows.Forms.Application.Run(cPEGenerateDlg);
            cPEGenerateDlg.Dispose();

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