Ejemplo n.º 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);
    }
Ejemplo n.º 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);
    }