Example #1
0
        private static MenuBarManager.CallbackStatus PartGen(MenuButtonEvent ev)
        {
            //Get data from block dialog
            block_dialog bracket_parameters = new block_dialog();

            bracket_parameters.Show();

            double base_thick  = bracket_parameters.BaseThickness;
            double base_length = bracket_parameters.BaseLength;
            double back_thick  = bracket_parameters.BackThickness;
            double back_height = bracket_parameters.BackHeight;
            double fillet_rad  = bracket_parameters.FilletRadius;

            //Pass to "journal"
            NXJournal bracket = new NXJournal();

            bracket.SetBracketDimensions(base_thick, base_length, back_thick, back_height, fillet_rad);

            return(MenuBarManager.CallbackStatus.Continue);
        }
Example #2
0
    //------------------------------- 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 UI Styler programmer's guide"
    //        2) Invoke the Shared Library through File->Execute->NX Open menu.
    //
    //------------------------------------------------------------------------------
    public static void Main()
    {
        block_dialog theblock_dialog = null;

        try
        {
            theblock_dialog = new block_dialog();
            // The following method shows the dialog immediately
            theblock_dialog.Show();
        }
        catch (Exception ex)
        {
            //---- Enter your exception handling code here -----
            theUI.NXMessageBox.Show("Block Styler", NXMessageBox.DialogType.Error, ex.ToString());
        }
        finally
        {
            if (theblock_dialog != null)
            {
                theblock_dialog.Dispose();
            }
            theblock_dialog = null;
        }
    }