/** * Startup * Entrypoint used when program is loaded automatically * as NX starts up. Note this application must be placed in a * special folder for NX to find and load it during startup. * Refer to the NX Open documentation for more details on how * NX finds and loads applications during startup. */ public static int Startup() { int retValue = 0; try { CustomMenuCreator menuCreator = GetInstance(); menuCreator.RegisterCallbacks(); } catch (NXOpen.NXException ex) { // ---- Enter your exception handling code here ----- UI.GetUI().NXMessageBox.Show("Caught exception", NXMessageBox.DialogType.Error, ex.Message); } return(retValue); }
/** * Following method cleanup any housekeeping chores that may be needed. * This method is automatically called by NX. */ public static void UnloadLibrary() { try { if (m_MenuHandler != null) { m_MenuHandler.Dispose(); m_MenuHandler = null; } if (m_Instance != null) { m_Instance = null; } } catch (Exception ex) { //---- Enter your exception handling code here ----- m_UI.NXMessageBox.Show("Menu creator", NXOpen.NXMessageBox.DialogType.Information, ex.Message); } }