private static void Show() { var mark = Snap.Globals.SetUndoMark(Snap.Globals.MarkVisibility.Invisible, "CMMManualShow"); try { CMM.Entry.ImportProbePart(); //导入探针数据 var ui = new CMMProgramUI(); ui.Show(); } catch (Exception ex) { System.Windows.Forms.MessageBox.Show(ex.Message); } finally { try { Snap.Globals.UndoToMark(mark, null); } catch (Exception ex1) { System.Windows.Forms.MessageBox.Show(ex1.Message); } } }
//------------------------------- DIALOG LAUNCHING --------------------------------- // // Before invoking this application one needs to open any part/empty part in NX // because of the behavior of the blocks. // // Make sure the dlx file is in one of the following locations: // 1.) From where NX session is launched // 2.) $UGII_USER_DIR/application // 3.) For released applications, using UGII_CUSTOM_DIRECTORY_FILE is highly // recommended. This variable is set to a full directory path to a file // containing a list of root directories for all custom applications. // e.g., UGII_CUSTOM_DIRECTORY_FILE=$UGII_ROOT_DIR\menus\custom_dirs.dat // // You can create the dialog using one of the following way: // // 1. Journal Replay // // 1) Replay this file through Tool->Journal->Play Menu. // // 2. USER EXIT // // 1) Create the Shared Library -- Refer "Block Styler programmer's guide" // 2) Invoke the Shared Library through File->Execute->NX Open menu. // //------------------------------------------------------------------------------ public static void Main() { try { theCMMProgramUI = new CMMProgramUI(); // The following method shows the dialog immediately theCMMProgramUI.Show(); } catch (Exception ex) { //---- Enter your exception handling code here ----- theUI.NXMessageBox.Show("Block Styler", NXMessageBox.DialogType.Error, ex.ToString()); } finally { theCMMProgramUI.Dispose(); } }