Beispiel #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);
    }
Beispiel #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();
                MEOpenTaskDlg cMEOpenTaskDlg = new MEOpenTaskDlg();
                FormUtilities.ReparentForm(cMEOpenTaskDlg);
                System.Windows.Forms.Application.Run(cMEOpenTaskDlg);
                cMEOpenTaskDlg.Dispose();
            }
            theProgram.Dispose();
        }
        catch (NXOpen.NXException ex)
        {
            // ---- Enter your exception handling code here -----
        }
        return(retValue);
    }