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

            //模組檢查
            int module_id;
            theUfSession.UF.AskApplicationModule(out module_id);
            if (module_id != UFConstants.UF_APP_DRAFTING)
            {
                MessageBox.Show("請先轉換為製圖(Drafting)模組後再執行!");
                return(retValue);
            }


            Application.EnableVisualStyles();
            AssignDlg cAssignDlg = new AssignDlg();
            FormUtilities.ReparentForm(cAssignDlg);
            System.Windows.Forms.Application.Run(cAssignDlg);
            cAssignDlg.Dispose();


            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

            Application.EnableVisualStyles();
            AssignDlg cAssignDlg = new AssignDlg();
            FormUtilities.ReparentForm(cAssignDlg);
            System.Windows.Forms.Application.Run(cAssignDlg);
            cAssignDlg.Dispose();


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