Пример #1
0
    //------------------------------------------------------------------------------
    //---------------------Block UI Styler Callback Functions--------------------------
    //------------------------------------------------------------------------------

    //------------------------------------------------------------------------------
    //Callback Name: initialize_cb
    //------------------------------------------------------------------------------
    public void initialize_cb()
    {
        try
        {
            group                 = (NXOpen.BlockStyler.Group)theDialog.TopBlock.FindBlock("group");
            selectCuprum          = (NXOpen.BlockStyler.SelectObject)theDialog.TopBlock.FindBlock("selectCuprum");
            strElecName           = (NXOpen.BlockStyler.StringBlock)theDialog.TopBlock.FindBlock("strElecName");
            strElecSize           = (NXOpen.BlockStyler.StringBlock)theDialog.TopBlock.FindBlock("strElecSize");
            strElecCuttingSize    = (NXOpen.BlockStyler.StringBlock)theDialog.TopBlock.FindBlock("strElecCuttingSize");
            groupSElec            = (NXOpen.BlockStyler.Group)theDialog.TopBlock.FindBlock("groupSElec");
            selectTopFace         = (NXOpen.BlockStyler.SelectObject)theDialog.TopBlock.FindBlock("selectTopFace");
            selectBaseFace        = (NXOpen.BlockStyler.SelectObject)theDialog.TopBlock.FindBlock("selectBaseFace");
            selectBaseFacePoint   = (NXOpen.BlockStyler.SelectObject)theDialog.TopBlock.FindBlock("selectBaseFacePoint");
            selectBaseFacePointEx = (NXOpen.BlockStyler.SpecifyPoint)theDialog.TopBlock.FindBlock("selectBaseFacePointEx");
            group1                = (NXOpen.BlockStyler.Group)theDialog.TopBlock.FindBlock("group1");
            scrolledWindow        = (NXOpen.BlockStyler.ScrolledWindow)theDialog.TopBlock.FindBlock("scrolledWindow");
            txtFINISHNUMBER       = (NXOpen.BlockStyler.IntegerBlock)theDialog.TopBlock.FindBlock("txtFINISHNUMBER");
            txtMIDDLENUMBER       = (NXOpen.BlockStyler.IntegerBlock)theDialog.TopBlock.FindBlock("txtMIDDLENUMBER");
            txtROUGHNUMBER        = (NXOpen.BlockStyler.IntegerBlock)theDialog.TopBlock.FindBlock("txtROUGHNUMBER");
            cboxMATNAME           = (NXOpen.BlockStyler.Enumeration)theDialog.TopBlock.FindBlock("cboxMATNAME");
            cboxMMATNAME          = (NXOpen.BlockStyler.Enumeration)theDialog.TopBlock.FindBlock("cboxMMATNAME");
            cboxRMATNAME          = (NXOpen.BlockStyler.Enumeration)theDialog.TopBlock.FindBlock("cboxRMATNAME");
            cbbProdirection       = (NXOpen.BlockStyler.Enumeration)theDialog.TopBlock.FindBlock("cbbProdirection");
            scrolledWindow1       = (NXOpen.BlockStyler.ScrolledWindow)theDialog.TopBlock.FindBlock("scrolledWindow1");
            txtFINISHSPACE        = (NXOpen.BlockStyler.DoubleBlock)theDialog.TopBlock.FindBlock("txtFINISHSPACE");
            txtMIDDLESPACE        = (NXOpen.BlockStyler.DoubleBlock)theDialog.TopBlock.FindBlock("txtMIDDLESPACE");
            txtROUGHSPACE         = (NXOpen.BlockStyler.DoubleBlock)theDialog.TopBlock.FindBlock("txtROUGHSPACE");
            cbbElecType           = (NXOpen.BlockStyler.Enumeration)theDialog.TopBlock.FindBlock("cbbElecType");
            cbbRock               = (NXOpen.BlockStyler.Enumeration)theDialog.TopBlock.FindBlock("cbbRock");
            stringExp             = (NXOpen.BlockStyler.StringBlock)theDialog.TopBlock.FindBlock("stringExp");
            stringExp1            = (NXOpen.BlockStyler.StringBlock)theDialog.TopBlock.FindBlock("stringExp1");
            scrolledWindow11      = (NXOpen.BlockStyler.ScrolledWindow)theDialog.TopBlock.FindBlock("scrolledWindow11");
            cbbFSmoth             = (NXOpen.BlockStyler.Enumeration)theDialog.TopBlock.FindBlock("cbbFSmoth");
            cbbMSmoth             = (NXOpen.BlockStyler.Enumeration)theDialog.TopBlock.FindBlock("cbbMSmoth");
            cbbRSmoth             = (NXOpen.BlockStyler.Enumeration)theDialog.TopBlock.FindBlock("cbbRSmoth");
            cbbChuckType          = (NXOpen.BlockStyler.Enumeration)theDialog.TopBlock.FindBlock("cbbChuckType");
            cbbCAPSET             = (NXOpen.BlockStyler.Enumeration)theDialog.TopBlock.FindBlock("cbbCAPSET");
            cbbRockShape          = (NXOpen.BlockStyler.Enumeration)theDialog.TopBlock.FindBlock("cbbRockShape");
            cbbShape              = (NXOpen.BlockStyler.Enumeration)theDialog.TopBlock.FindBlock("cbbShape");
        }
        catch (Exception ex)
        {
            //---- Enter your exception handling code here -----
            theUI.NXMessageBox.Show("Block Styler", NXMessageBox.DialogType.Error, ex.ToString());
        }
    }
Пример #2
0
        //------------------------------------------------------------------------------
        //---------------------Block UI Styler Callback Functions--------------------------
        //------------------------------------------------------------------------------

        //------------------------------------------------------------------------------
        //Callback Name: initialize_cb
        //------------------------------------------------------------------------------
        public void initialize_cb()
        {
            try
            {
                group           = (NXOpen.BlockStyler.Group)theDialog.TopBlock.FindBlock("group");
                scrolledWindow  = (NXOpen.BlockStyler.ScrolledWindow)theDialog.TopBlock.FindBlock("scrolledWindow");
                strType1        = (NXOpen.BlockStyler.StringBlock)theDialog.TopBlock.FindBlock("strType1");
                png             = (NXOpen.BlockStyler.DrawingArea)theDialog.TopBlock.FindBlock("png");
                scrolledWindow1 = (NXOpen.BlockStyler.ScrolledWindow)theDialog.TopBlock.FindBlock("scrolledWindow1");
                bodySelectA     = (NXOpen.BlockStyler.BodyCollector)theDialog.TopBlock.FindBlock("bodySelectA");
                label0          = (NXOpen.BlockStyler.Label)theDialog.TopBlock.FindBlock("label0");
                bodySelectB     = (NXOpen.BlockStyler.BodyCollector)theDialog.TopBlock.FindBlock("bodySelectB");
                label01         = (NXOpen.BlockStyler.Label)theDialog.TopBlock.FindBlock("label01");
                buttonOk        = (NXOpen.BlockStyler.Button)theDialog.TopBlock.FindBlock("buttonOk");
                group3          = (NXOpen.BlockStyler.Group)theDialog.TopBlock.FindBlock("group3");
                stringName      = (NXOpen.BlockStyler.StringBlock)theDialog.TopBlock.FindBlock("stringName");
                seleBody        = (NXOpen.BlockStyler.BodyCollector)theDialog.TopBlock.FindBlock("seleBody");
                buttonOk1       = (NXOpen.BlockStyler.Button)theDialog.TopBlock.FindBlock("buttonOk1");
                group1          = (NXOpen.BlockStyler.Group)theDialog.TopBlock.FindBlock("group1");
                treeInfo        = (NXOpen.BlockStyler.Tree)theDialog.TopBlock.FindBlock("treeInfo");
                group2          = (NXOpen.BlockStyler.Group)theDialog.TopBlock.FindBlock("group2");
                strType         = (NXOpen.BlockStyler.StringBlock)theDialog.TopBlock.FindBlock("strType");
                mulMessage      = (NXOpen.BlockStyler.MultilineString)theDialog.TopBlock.FindBlock("mulMessage");
                //------------------------------------------------------------------------------
                //Registration of Treelist specific callbacks
                //------------------------------------------------------------------------------
                //treeInfo.SetOnExpandHandler(new NXOpen.BlockStyler.Tree.OnExpandCallback(OnExpandCallback));

                //treeInfo.SetOnInsertColumnHandler(new NXOpen.BlockStyler.Tree.OnInsertColumnCallback(OnInsertColumnCallback));

                //treeInfo.SetOnInsertNodeHandler(new NXOpen.BlockStyler.Tree.OnInsertNodeCallback(OnInsertNodecallback));

                //treeInfo.SetOnDeleteNodeHandler(new NXOpen.BlockStyler.Tree.OnDeleteNodeCallback(OnDeleteNodecallback));

                //treeInfo.SetOnPreSelectHandler(new NXOpen.BlockStyler.Tree.OnPreSelectCallback(OnPreSelectcallback));

                treeInfo.SetOnSelectHandler(new NXOpen.BlockStyler.Tree.OnSelectCallback(OnSelectcallback));

                //treeInfo.SetOnStateChangeHandler(new NXOpen.BlockStyler.Tree.OnStateChangeCallback(OnStateChangecallback));

                //treeInfo.SetToolTipTextHandler(new NXOpen.BlockStyler.Tree.ToolTipTextCallback(ToolTipTextcallback));

                //treeInfo.SetColumnSortHandler(new NXOpen.BlockStyler.Tree.ColumnSortCallback(ColumnSortcallback));

                //treeInfo.SetStateIconNameHandler(new NXOpen.BlockStyler.Tree.StateIconNameCallback(StateIconNameCallback));

                treeInfo.SetOnBeginLabelEditHandler(new NXOpen.BlockStyler.Tree.OnBeginLabelEditCallback(OnBeginLabelEditCallback));

                treeInfo.SetOnEndLabelEditHandler(new NXOpen.BlockStyler.Tree.OnEndLabelEditCallback(OnEndLabelEditCallback));

                treeInfo.SetOnEditOptionSelectedHandler(new NXOpen.BlockStyler.Tree.OnEditOptionSelectedCallback(OnEditOptionSelectedCallback));

                treeInfo.SetAskEditControlHandler(new NXOpen.BlockStyler.Tree.AskEditControlCallback(AskEditControlCallback));

                treeInfo.SetOnMenuHandler(new NXOpen.BlockStyler.Tree.OnMenuCallback(OnMenuCallback));;

                treeInfo.SetOnMenuSelectionHandler(new NXOpen.BlockStyler.Tree.OnMenuSelectionCallback(OnMenuSelectionCallback));;

                //treeInfo.SetIsDropAllowedHandler(new NXOpen.BlockStyler.Tree.IsDropAllowedCallback(IsDropAllowedCallback));;

                //treeInfo.SetIsDragAllowedHandler(new NXOpen.BlockStyler.Tree.IsDragAllowedCallback(IsDragAllowedCallback));;

                //treeInfo.SetOnDropHandler(new NXOpen.BlockStyler.Tree.OnDropCallback(OnDropCallback));;

                //treeInfo.SetOnDropMenuHandler(new NXOpen.BlockStyler.Tree.OnDropMenuCallback(OnDropMenuCallback));

                //treeInfo.SetOnDefaultActionHandler(new NXOpen.BlockStyler.Tree.OnDefaultActionCallback(OnDefaultActionCallback));

                //------------------------------------------------------------------------------
            }
            catch (Exception ex)
            {
                //---- Enter your exception handling code here -----
                theUI.NXMessageBox.Show("Block Styler", NXMessageBox.DialogType.Error, ex.ToString());
            }
        }