Ejemplo n.º 1
0
 //------------------------------------------------------------------------------
 //Callback Name: initialize_cb
 //------------------------------------------------------------------------------
 public void initialize_cb()
 {
     try
     {
         tabControl    = theDialog.TopBlock.FindBlock("tabControl");
         tabPage       = theDialog.TopBlock.FindBlock("tabPage");
         group5        = theDialog.TopBlock.FindBlock("group5");
         enum02        = theDialog.TopBlock.FindBlock("enum02");
         group1        = theDialog.TopBlock.FindBlock("group1");
         enum0         = theDialog.TopBlock.FindBlock("enum0");
         label01       = theDialog.TopBlock.FindBlock("label01");
         button0       = theDialog.TopBlock.FindBlock("button0");
         tabPage1      = theDialog.TopBlock.FindBlock("tabPage1");
         group4        = theDialog.TopBlock.FindBlock("group4");
         label02       = theDialog.TopBlock.FindBlock("label02");
         integer0      = theDialog.TopBlock.FindBlock("integer0");
         label03       = theDialog.TopBlock.FindBlock("label03");
         integer01     = theDialog.TopBlock.FindBlock("integer01");
         group3        = theDialog.TopBlock.FindBlock("group3");
         face_select0  = theDialog.TopBlock.FindBlock("face_select0");
         enum01        = theDialog.TopBlock.FindBlock("enum01");
         button02      = theDialog.TopBlock.FindBlock("button02");
         group         = theDialog.TopBlock.FindBlock("group");
         bodySelect0   = theDialog.TopBlock.FindBlock("bodySelect0");
         vector0       = theDialog.TopBlock.FindBlock("vector0");
         group2        = theDialog.TopBlock.FindBlock("group2");
         double0       = theDialog.TopBlock.FindBlock("double0");
         label0        = theDialog.TopBlock.FindBlock("label0");
         toggle0       = theDialog.TopBlock.FindBlock("toggle0");
         colorPicker0  = theDialog.TopBlock.FindBlock("colorPicker0");
         toggle01      = theDialog.TopBlock.FindBlock("toggle01");
         colorPicker01 = theDialog.TopBlock.FindBlock("colorPicker01");
         toggle02      = theDialog.TopBlock.FindBlock("toggle02");
         colorPicker02 = theDialog.TopBlock.FindBlock("colorPicker02");
         toggle03      = theDialog.TopBlock.FindBlock("toggle03");
         colorPicker03 = theDialog.TopBlock.FindBlock("colorPicker03");
         toggle04      = theDialog.TopBlock.FindBlock("toggle04");
         colorPicker04 = theDialog.TopBlock.FindBlock("colorPicker04");
         toggle05      = theDialog.TopBlock.FindBlock("toggle05");
         colorPicker05 = theDialog.TopBlock.FindBlock("colorPicker05");
         button01      = theDialog.TopBlock.FindBlock("button01");
     }
     catch (Exception ex)
     {
         theUI.NXMessageBox.Show("Block Styler", NXMessageBox.DialogType.Error, ex.ToString());
     }
 }
Ejemplo n.º 2
0
        //------------------------------------------------------------------------------
        //---------------------Block UI Styler Callback Functions--------------------------
        //------------------------------------------------------------------------------

        //------------------------------------------------------------------------------
        //Callback Name: initialize_cb
        //------------------------------------------------------------------------------
        public void initialize_cb()
        {
            try
            {
                group0     = (NXOpen.BlockStyler.Group)theDialog.TopBlock.FindBlock("group0");
                group      = (NXOpen.BlockStyler.Group)theDialog.TopBlock.FindBlock("group");
                selectiObj = (NXOpen.BlockStyler.SelectObject)theDialog.TopBlock.FindBlock("selectiObj");
                group1     = (NXOpen.BlockStyler.Group)theDialog.TopBlock.FindBlock("group1");
                vector     = (NXOpen.BlockStyler.SpecifyVector)theDialog.TopBlock.FindBlock("vector");
                group3     = (NXOpen.BlockStyler.Group)theDialog.TopBlock.FindBlock("group3");
                label01    = (NXOpen.BlockStyler.Label)theDialog.TopBlock.FindBlock("label01");
                labelFace  = (NXOpen.BlockStyler.Label)theDialog.TopBlock.FindBlock("labelFace");
                label011   = (NXOpen.BlockStyler.Label)theDialog.TopBlock.FindBlock("label011");
                labelDia   = (NXOpen.BlockStyler.Label)theDialog.TopBlock.FindBlock("labelDia");
                group2     = (NXOpen.BlockStyler.Group)theDialog.TopBlock.FindBlock("group2");
                color      = (NXOpen.BlockStyler.Toggle)theDialog.TopBlock.FindBlock("color");

                Selection.MaskTriple maskFace = new Selection.MaskTriple() //面
                {
                    Type             = 70,
                    Subtype          = 2,
                    SolidBodySubtype = UFConstants.UF_UI_SEL_FEATURE_ANY_FACE
                };
                Selection.MaskTriple maskBody = new Selection.MaskTriple() //面
                {
                    Type             = 70,
                    Subtype          = 0,
                    SolidBodySubtype = UFConstants.UF_UI_SEL_FEATURE_BODY
                };
                Selection.MaskTriple[] masks = { maskFace, maskBody };
                this.selectiObj.SetSelectionFilter(Selection.SelectionAction.ClearAndEnableSpecific, masks);//过滤只选择体和面
            }
            catch (Exception ex)
            {
                //---- Enter your exception handling code here -----
                theUI.NXMessageBox.Show("Block Styler", NXMessageBox.DialogType.Error, ex.ToString());
            }
        }
Ejemplo n.º 3
0
    //------------------------------------------------------------------------------
    //---------------------Block UI Styler Callback Functions--------------------------
    //------------------------------------------------------------------------------

    //------------------------------------------------------------------------------
    //Callback Name: initialize_cb
    //------------------------------------------------------------------------------
    public void initialize_cb()
    {
        try
        {
            label0             = (NXOpen.BlockStyler.Label)theDialog.TopBlock.FindBlock("label0");
            explorer           = (NXOpen.BlockStyler.Explorer)theDialog.TopBlock.FindBlock("explorer");
            explorerNode       = (NXOpen.BlockStyler.Group)theDialog.TopBlock.FindBlock("explorerNode");
            stringLabelTool    = (NXOpen.BlockStyler.Label)theDialog.TopBlock.FindBlock("stringLabelTool");
            integerToolDiam    = (NXOpen.BlockStyler.IntegerBlock)theDialog.TopBlock.FindBlock("integerToolDiam");
            separator011       = (NXOpen.BlockStyler.Separator)theDialog.TopBlock.FindBlock("separator011");
            offsetOfTool       = (NXOpen.BlockStyler.IntegerBlock)theDialog.TopBlock.FindBlock("offsetOfTool");
            separator02        = (NXOpen.BlockStyler.Separator)theDialog.TopBlock.FindBlock("separator02");
            multiline_string01 = (NXOpen.BlockStyler.MultilineString)theDialog.TopBlock.FindBlock("multiline_string01");
            separator03        = (NXOpen.BlockStyler.Separator)theDialog.TopBlock.FindBlock("separator03");
            stringLabelHolder  = (NXOpen.BlockStyler.Label)theDialog.TopBlock.FindBlock("stringLabelHolder");
            separator04        = (NXOpen.BlockStyler.Separator)theDialog.TopBlock.FindBlock("separator04");
            stringLibRef1      = (NXOpen.BlockStyler.StringBlock)theDialog.TopBlock.FindBlock("stringLibRef1");
            separator05        = (NXOpen.BlockStyler.Separator)theDialog.TopBlock.FindBlock("separator05");
            multiline_string0  = (NXOpen.BlockStyler.MultilineString)theDialog.TopBlock.FindBlock("multiline_string0");
            separator06        = (NXOpen.BlockStyler.Separator)theDialog.TopBlock.FindBlock("separator06");
            tree_control0      = (NXOpen.BlockStyler.Tree)theDialog.TopBlock.FindBlock("tree_control0");
            //------------------------------------------------------------------------------
            //Registration of Treelist specific callbacks
            //------------------------------------------------------------------------------
            //tree_control0.SetOnExpandHandler(new NXOpen.BlockStyler.Tree.OnExpandCallback(OnExpandCallback));

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

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

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

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

            //tree_control0.SetOnSelectHandler(new NXOpen.BlockStyler.Tree.OnSelectCallback(OnSelectcallback));

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

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

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

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

            //tree_control0.SetOnBeginLabelEditHandler(new NXOpen.BlockStyler.Tree.OnBeginLabelEditCallback(OnBeginLabelEditCallback));

            //tree_control0.SetOnEndLabelEditHandler(new NXOpen.BlockStyler.Tree.OnEndLabelEditCallback(OnEndLabelEditCallback));

            //tree_control0.SetOnEditOptionSelectedHandler(new NXOpen.BlockStyler.Tree.OnEditOptionSelectedCallback(OnEditOptionSelectedCallback));

            //tree_control0.SetAskEditControlHandler(new NXOpen.BlockStyler.Tree.AskEditControlCallback(AskEditControlCallback));

            //tree_control0.SetOnMenuHandler(new NXOpen.BlockStyler.Tree.OnMenuCallback(OnMenuCallback));;

            //tree_control0.SetOnMenuSelectionHandler(new NXOpen.BlockStyler.Tree.OnMenuSelectionCallback(OnMenuSelectionCallback));;

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

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

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

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

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

            //------------------------------------------------------------------------------
            //------------------------------------------------------------------------------
            //Registration of StringBlock specific callbacks
            //------------------------------------------------------------------------------
            //stringLibRef1.SetKeystrokeCallback(new NXOpen.BlockStyler.StringBlock.KeystrokeCallback(KeystrokeCallback));

            //------------------------------------------------------------------------------
            //------------------------------------------------------------------------------
            //Registration of Explorer, explorer specific callbacks
            //------------------------------------------------------------------------------
            //explorer.SetNotifyNodeSelectedPreHandler(new NXOpen.BlockStyler.Explorer.NotifyNodeSelectedPreCallback(notifyNodeSelectedPreCallback));

            //explorer.SetNotifyNodeSelectedPostHandler(new NXOpen.BlockStyler.Explorer.NotifyNodeSelectedPostCallback(notifyNodeSelectedPostCallback));
        }
        catch (Exception ex)
        {
            //---- Enter your exception handling code here -----
            theUI.NXMessageBox.Show("Block Styler", NXMessageBox.DialogType.Error, ex.ToString());
        }
    }
Ejemplo n.º 4
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());
            }
        }
Ejemplo n.º 5
0
        //------------------------------------------------------------------------------
        //---------------------Block UI Styler Callback Functions--------------------------
        //------------------------------------------------------------------------------

        //------------------------------------------------------------------------------
        //Callback Name: initialize_cb
        //------------------------------------------------------------------------------
        public void initialize_cb()
        {
            try
            {
                group0          = (NXOpen.BlockStyler.Group)theDialog.TopBlock.FindBlock("group0");
                type            = (NXOpen.BlockStyler.Enumeration)theDialog.TopBlock.FindBlock("type");
                group           = (NXOpen.BlockStyler.Group)theDialog.TopBlock.FindBlock("group");
                selectObject    = (NXOpen.BlockStyler.SelectObject)theDialog.TopBlock.FindBlock("selectObject");
                manip           = (NXOpen.BlockStyler.SpecifyOrientation)theDialog.TopBlock.FindBlock("manip");
                vector          = (NXOpen.BlockStyler.SpecifyVector)theDialog.TopBlock.FindBlock("vector");
                group1          = (NXOpen.BlockStyler.Group)theDialog.TopBlock.FindBlock("group1");
                boolOffset      = (NXOpen.BlockStyler.Toggle)theDialog.TopBlock.FindBlock("boolOffset");
                dimOffset       = (NXOpen.BlockStyler.LinearDimension)theDialog.TopBlock.FindBlock("dimOffset");
                group5          = (NXOpen.BlockStyler.Group)theDialog.TopBlock.FindBlock("group5");
                positiveX       = (NXOpen.BlockStyler.LinearDimension)theDialog.TopBlock.FindBlock("positiveX");
                negativeX       = (NXOpen.BlockStyler.LinearDimension)theDialog.TopBlock.FindBlock("negativeX");
                positiveY       = (NXOpen.BlockStyler.LinearDimension)theDialog.TopBlock.FindBlock("positiveY");
                negativeY       = (NXOpen.BlockStyler.LinearDimension)theDialog.TopBlock.FindBlock("negativeY");
                negativeZ       = (NXOpen.BlockStyler.LinearDimension)theDialog.TopBlock.FindBlock("negativeZ");
                positiveZ       = (NXOpen.BlockStyler.LinearDimension)theDialog.TopBlock.FindBlock("positiveZ");
                radial          = (NXOpen.BlockStyler.LinearDimension)theDialog.TopBlock.FindBlock("radial");
                group2          = (NXOpen.BlockStyler.Group)theDialog.TopBlock.FindBlock("group2");
                boolHide        = (NXOpen.BlockStyler.Toggle)theDialog.TopBlock.FindBlock("boolHide");
                boolUnite       = (NXOpen.BlockStyler.Toggle)theDialog.TopBlock.FindBlock("boolUnite");
                boolPlane       = (NXOpen.BlockStyler.Toggle)theDialog.TopBlock.FindBlock("boolPlane");
                boolSurface     = (NXOpen.BlockStyler.Toggle)theDialog.TopBlock.FindBlock("boolSurface");
                group3          = (NXOpen.BlockStyler.Group)theDialog.TopBlock.FindBlock("group3");
                intTranslucency = (NXOpen.BlockStyler.IntegerBlock)theDialog.TopBlock.FindBlock("intTranslucency");
                intLayer        = (NXOpen.BlockStyler.IntegerBlock)theDialog.TopBlock.FindBlock("intLayer");
                intColor        = (NXOpen.BlockStyler.ObjectColorPicker)theDialog.TopBlock.FindBlock("intColor");
                group4          = (NXOpen.BlockStyler.Group)theDialog.TopBlock.FindBlock("group4");
                bttPreview      = (NXOpen.BlockStyler.Button)theDialog.TopBlock.FindBlock("bttPreview");
                strPreview      = (NXOpen.BlockStyler.Label)theDialog.TopBlock.FindBlock("strPreview");
                #region  择过滤
                Selection.MaskTriple maskFace = new Selection.MaskTriple() //面
                {
                    Type             = 70,
                    Subtype          = 2,
                    SolidBodySubtype = UFConstants.UF_UI_SEL_FEATURE_ANY_FACE
                };
                Selection.MaskTriple maskPoint = new Selection.MaskTriple() //点
                {
                    Type             = 2,
                    Subtype          = 0,
                    SolidBodySubtype = 0
                };
                Selection.MaskTriple maskCurve = new Selection.MaskTriple() //线
                {
                    Type             = 3,
                    Subtype          = 0,
                    SolidBodySubtype = 0
                };
                Selection.MaskTriple maskEdge = new Selection.MaskTriple() //边
                {
                    Type             = 70,
                    Subtype          = 3,
                    SolidBodySubtype = UFConstants.UF_UI_SEL_FEATURE_ANY_EDGE
                };

                Selection.MaskTriple[] masks = { maskFace, maskPoint, maskCurve, maskEdge };
                selectObject.SetSelectionFilter(Selection.SelectionAction.ClearAndEnableSpecific, masks);//过滤只选择点和面
                #endregion


                SetLinearDimensionShow(false);
                radial.Show = false;
            }
            catch (Exception ex)
            {
                //---- Enter your exception handling code here -----
                theUI.NXMessageBox.Show("Block Styler", NXMessageBox.DialogType.Error, ex.ToString());
            }
        }
Ejemplo n.º 6
0
    //------------------------------------------------------------------------------
    //---------------------Block UI Styler Callback Functions--------------------------
    //------------------------------------------------------------------------------

    //------------------------------------------------------------------------------
    //Callback Name: initialize_cb
    //------------------------------------------------------------------------------
    public void initialize_cb()
    {
        try
        {
            group3        = (NXOpen.BlockStyler.Group)theDialog.TopBlock.FindBlock("group3");
            button05      = (NXOpen.BlockStyler.Button)theDialog.TopBlock.FindBlock("button05");
            face_select0  = (NXOpen.BlockStyler.FaceCollector)theDialog.TopBlock.FindBlock("face_select0");
            face_select01 = (NXOpen.BlockStyler.FaceCollector)theDialog.TopBlock.FindBlock("face_select01");
            face_select02 = (NXOpen.BlockStyler.FaceCollector)theDialog.TopBlock.FindBlock("face_select02");
            enum01        = (NXOpen.BlockStyler.Enumeration)theDialog.TopBlock.FindBlock("enum01");
            button04      = (NXOpen.BlockStyler.Button)theDialog.TopBlock.FindBlock("button04");
            group1        = (NXOpen.BlockStyler.Group)theDialog.TopBlock.FindBlock("group1");
            enum0         = (NXOpen.BlockStyler.Enumeration)theDialog.TopBlock.FindBlock("enum0");
            group         = (NXOpen.BlockStyler.Group)theDialog.TopBlock.FindBlock("group");
            label04       = (NXOpen.BlockStyler.Label)theDialog.TopBlock.FindBlock("label04");
            separator02   = (NXOpen.BlockStyler.Separator)theDialog.TopBlock.FindBlock("separator02");
            toggle0       = (NXOpen.BlockStyler.Toggle)theDialog.TopBlock.FindBlock("toggle0");
            double0       = (NXOpen.BlockStyler.DoubleBlock)theDialog.TopBlock.FindBlock("double0");
            toggle01      = (NXOpen.BlockStyler.Toggle)theDialog.TopBlock.FindBlock("toggle01");
            double01      = (NXOpen.BlockStyler.DoubleBlock)theDialog.TopBlock.FindBlock("double01");
            toggle02      = (NXOpen.BlockStyler.Toggle)theDialog.TopBlock.FindBlock("toggle02");
            double02      = (NXOpen.BlockStyler.DoubleBlock)theDialog.TopBlock.FindBlock("double02");
            separator01   = (NXOpen.BlockStyler.Separator)theDialog.TopBlock.FindBlock("separator01");
            enum02        = (NXOpen.BlockStyler.Enumeration)theDialog.TopBlock.FindBlock("enum02");
            enum03        = (NXOpen.BlockStyler.Enumeration)theDialog.TopBlock.FindBlock("enum03");
            double03      = (NXOpen.BlockStyler.DoubleBlock)theDialog.TopBlock.FindBlock("double03");
            separator0    = (NXOpen.BlockStyler.Separator)theDialog.TopBlock.FindBlock("separator0");
            tree_control0 = (NXOpen.BlockStyler.Tree)theDialog.TopBlock.FindBlock("tree_control0");
            button0       = (NXOpen.BlockStyler.Button)theDialog.TopBlock.FindBlock("button0");
            button01      = (NXOpen.BlockStyler.Button)theDialog.TopBlock.FindBlock("button01");
            button02      = (NXOpen.BlockStyler.Button)theDialog.TopBlock.FindBlock("button02");
            button03      = (NXOpen.BlockStyler.Button)theDialog.TopBlock.FindBlock("button03");
            button06      = (NXOpen.BlockStyler.Button)theDialog.TopBlock.FindBlock("button06");
            button07      = (NXOpen.BlockStyler.Button)theDialog.TopBlock.FindBlock("button07");
            button08      = (NXOpen.BlockStyler.Button)theDialog.TopBlock.FindBlock("button08");
            //------------------------------------------------------------------------------
            //Registration of Treelist specific callbacks
            //------------------------------------------------------------------------------
            //tree_control0.SetOnExpandHandler(new NXOpen.BlockStyler.Tree.OnExpandCallback(OnExpandCallback));

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

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

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

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

            //tree_control0.SetOnSelectHandler(new NXOpen.BlockStyler.Tree.OnSelectCallback(OnSelectcallback));

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

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

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

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

            //tree_control0.SetOnBeginLabelEditHandler(new NXOpen.BlockStyler.Tree.OnBeginLabelEditCallback(OnBeginLabelEditCallback));

            //tree_control0.SetOnEndLabelEditHandler(new NXOpen.BlockStyler.Tree.OnEndLabelEditCallback(OnEndLabelEditCallback));

            //tree_control0.SetOnEditOptionSelectedHandler(new NXOpen.BlockStyler.Tree.OnEditOptionSelectedCallback(OnEditOptionSelectedCallback));

            //tree_control0.SetAskEditControlHandler(new NXOpen.BlockStyler.Tree.AskEditControlCallback(AskEditControlCallback));

            //tree_control0.SetOnMenuHandler(new NXOpen.BlockStyler.Tree.OnMenuCallback(OnMenuCallback));;

            //tree_control0.SetOnMenuSelectionHandler(new NXOpen.BlockStyler.Tree.OnMenuSelectionCallback(OnMenuSelectionCallback));;

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

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

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

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

            //tree_control0.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());
        }
    }
Ejemplo n.º 7
0
    //------------------------------------------------------------------------------
    //---------------------Block UI Styler Callback Functions--------------------------
    //------------------------------------------------------------------------------

    //------------------------------------------------------------------------------
    //Callback Name: initialize_cb
    //------------------------------------------------------------------------------
    public void initialize_cb()
    {
        string[] arr     = _dataService.XMLService.NameArrays;
        int      toolQnt = _dataService.Data.ToolArray.Length;

        thNXTool[] tools = _dataService.Data.ToolArray;
        thNXTool   localTool;

        initArraysOfVariable(toolQnt);

        try
        {
            label0   = (NXOpen.BlockStyler.Label)theDialog.TopBlock.FindBlock("label0");
            explorer = (NXOpen.BlockStyler.Explorer)theDialog.TopBlock.FindBlock("explorer");

            //"explorerNode",
            //"stringLabelTool",
            //"doubleToolDiam",
            //"separator011",
            //"offsetOfTool",
            //"separator02",
            //"GUItoolDescription",
            //"separator03",
            //"stringLabelHolder",
            //"separator04",
            //"stringLibRef1",
            //"separator05",
            //"multiline_string0",
            //"separator06",
            //"tree_control0",

            for (int i = 0; i < toolQnt; i++)
            {
                string app = i.ToString();
                if (i == 0)
                {
                    app = String.Empty;
                }
                _explorerNodeList[i]       = (NXOpen.BlockStyler.Group)theDialog.TopBlock.FindBlock(arr[0] + app);
                _explorerNodeList[i].Label = String.Format("T{0} - {1}", tools[i].ToolNumber, tools[i].Tool.Name);
                _stringLabelToolList[i]    = (NXOpen.BlockStyler.Label)theDialog.TopBlock.FindBlock(arr[1] + app);
                _doubleToolDiamList[i]     = (NXOpen.BlockStyler.DoubleBlock)theDialog.TopBlock.FindBlock(arr[2] + app);
                _separator011List[i]       = (NXOpen.BlockStyler.Separator)theDialog.TopBlock.FindBlock(arr[3] + app);
                _offsetOfToolList[i]       = (NXOpen.BlockStyler.IntegerBlock)theDialog.TopBlock.FindBlock(arr[4] + app);
                _separator02List[i]        = (NXOpen.BlockStyler.Separator)theDialog.TopBlock.FindBlock(arr[5] + app);
                GUItoolDescriptionList[i]  = (NXOpen.BlockStyler.MultilineString)theDialog.TopBlock.FindBlock(arr[6] + app);
                _separator03List[i]        = (NXOpen.BlockStyler.Separator)theDialog.TopBlock.FindBlock(arr[7] + app);
                _stringLabelHolderList[i]  = (NXOpen.BlockStyler.Label)theDialog.TopBlock.FindBlock(arr[8] + app);
                _separator04List[i]        = (NXOpen.BlockStyler.Separator)theDialog.TopBlock.FindBlock(arr[9] + app);
                _stringLibRef1List[i]      = (NXOpen.BlockStyler.StringBlock)theDialog.TopBlock.FindBlock(arr[10] + app);
                _separator05List[i]        = (NXOpen.BlockStyler.Separator)theDialog.TopBlock.FindBlock(arr[11] + app);
                _multiline_string0List[i]  = (NXOpen.BlockStyler.MultilineString)theDialog.TopBlock.FindBlock(arr[12] + app);
                _separator06List[i]        = (NXOpen.BlockStyler.Separator)theDialog.TopBlock.FindBlock(arr[13] + app);
                _tree_control0List[i]      = (NXOpen.BlockStyler.Tree)theDialog.TopBlock.FindBlock(arr[14] + app);



                localTool = tools[i];
                if (localTool != null)
                {
                    try
                    {
                        //заполняем поля описания опарвки, инсутремнта и др.

                        _doubleToolDiamList[i].Value = localTool.Diam;                                   // диаметр инструмента
                        _offsetOfToolList[i].Value   = localTool.ZOffset;                                //  вылет инструмента
                        GUItoolDescriptionList[i].SetValue(new string[] { localTool.Desc });             // tool descr
                        _stringLibRef1List[i].Value = localTool.HolderLibraryRef;                        // HolderLibRef
                        _multiline_string0List[i].SetValue(new [] { localTool.CurrentToolHolderDescr }); // toolHolder descr
                        //refreshGUIValues();
                    }
                    catch (Exception ex)
                    {
                        theUI.NXMessageBox.Show("Ошибка при заполнении полей описания и Libref оправки и инструмента", NXMessageBox.DialogType.Error, ex.ToString());
                    }
                }


                //explorerNode = (NXOpen.BlockStyler.Group)theDialog.TopBlock.FindBlock("explorerNode");
                //stringLabelTool = (NXOpen.BlockStyler.Label)theDialog.TopBlock.FindBlock("stringLabelTool");
                //doubleToolDiam = (NXOpen.BlockStyler.DoubleBlock)theDialog.TopBlock.FindBlock("doubleToolDiam");
                //separator011 = (NXOpen.BlockStyler.Separator)theDialog.TopBlock.FindBlock("separator011");
                //offsetOfTool = (NXOpen.BlockStyler.IntegerBlock)theDialog.TopBlock.FindBlock("offsetOfTool");
                //separator02 = (NXOpen.BlockStyler.Separator)theDialog.TopBlock.FindBlock("separator02");
                //GUItoolDescription = (NXOpen.BlockStyler.MultilineString)theDialog.TopBlock.FindBlock("GUItoolDescription");
                //separator03 = (NXOpen.BlockStyler.Separator)theDialog.TopBlock.FindBlock("separator03");
                //stringLabelHolder = (NXOpen.BlockStyler.Label)theDialog.TopBlock.FindBlock("stringLabelHolder");
                //separator04 = (NXOpen.BlockStyler.Separator)theDialog.TopBlock.FindBlock("separator04");
                //stringLibRef1 = (NXOpen.BlockStyler.StringBlock)theDialog.TopBlock.FindBlock("stringLibRef1");
                //separator05 = (NXOpen.BlockStyler.Separator)theDialog.TopBlock.FindBlock("separator05");
                //multiline_string0 = (NXOpen.BlockStyler.MultilineString)theDialog.TopBlock.FindBlock("multiline_string0");
                //separator06 = (NXOpen.BlockStyler.Separator)theDialog.TopBlock.FindBlock("separator06");
                //tree_control0 = (NXOpen.BlockStyler.Tree)theDialog.TopBlock.FindBlock("tree_control0");


                //------------------------------------------------------------------------------
                //Registration of Treelist specific callbacks
                //------------------------------------------------------------------------------
                //tree_control0.SetOnExpandHandler(new NXOpen.BlockStyler.Tree.OnExpandCallback(OnExpandCallback));

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

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

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

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

                _tree_control0List[i].SetOnSelectHandler(new NXOpen.BlockStyler.Tree.OnSelectCallback(OnSelectcallback));
//           tree_control0.SetOnSelectHandler(new NXOpen.BlockStyler.Tree.OnSelectCallback(OnSelectcallback));

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

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

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

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

                //tree_control0.SetOnBeginLabelEditHandler(new NXOpen.BlockStyler.Tree.OnBeginLabelEditCallback(OnBeginLabelEditCallback));

                //tree_control0.SetOnEndLabelEditHandler(new NXOpen.BlockStyler.Tree.OnEndLabelEditCallback(OnEndLabelEditCallback));

                //tree_control0.SetOnEditOptionSelectedHandler(new NXOpen.BlockStyler.Tree.OnEditOptionSelectedCallback(OnEditOptionSelectedCallback));

                //tree_control0.SetAskEditControlHandler(new NXOpen.BlockStyler.Tree.AskEditControlCallback(AskEditControlCallback));

                //tree_control0.SetOnMenuHandler(new NXOpen.BlockStyler.Tree.OnMenuCallback(OnMenuCallback));;

                //tree_control0.SetOnMenuSelectionHandler(new NXOpen.BlockStyler.Tree.OnMenuSelectionCallback(OnMenuSelectionCallback));;

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

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

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

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

                _tree_control0List[i].SetOnDefaultActionHandler(new NXOpen.BlockStyler.Tree.OnDefaultActionCallback(OnDefaultActionCallback));
            }
            //------------------------------------------------------------------------------
            //------------------------------------------------------------------------------
            //Registration of StringBlock specific callbacks
            //------------------------------------------------------------------------------
            //stringLibRef1.SetKeystrokeCallback(new NXOpen.BlockStyler.StringBlock.KeystrokeCallback(KeystrokeCallback));

            //------------------------------------------------------------------------------
            //------------------------------------------------------------------------------
            //Registration of Explorer, explorer specific callbacks
            //------------------------------------------------------------------------------
            //explorer.SetNotifyNodeSelectedPreHandler(new NXOpen.BlockStyler.Explorer.NotifyNodeSelectedPreCallback(notifyNodeSelectedPreCallback));

            //explorer.SetNotifyNodeSelectedPostHandler(new NXOpen.BlockStyler.Explorer.NotifyNodeSelectedPostCallback(notifyNodeSelectedPostCallback));

            //---------------------------------

            // CreateAndAddNode("Test");
        }
        catch (Exception ex)
        {
            //---- Enter your exception handling code here -----
            theUI.NXMessageBox.Show("Block Styler", NXMessageBox.DialogType.Error, ex.ToString());
        }
    }
Ejemplo n.º 8
0
    //------------------------------------------------------------------------------
    //---------------------Block UI Styler Callback Functions--------------------------
    //------------------------------------------------------------------------------

    //------------------------------------------------------------------------------
    //Callback Name: initialize_cb
    //------------------------------------------------------------------------------
    public void initialize_cb()
    {
        try
        {
            grpSelection  = (NXOpen.BlockStyler.Group)theDialog.TopBlock.FindBlock("grpSelection");
            strWildcard   = (NXOpen.BlockStyler.StringBlock)theDialog.TopBlock.FindBlock("strWildcard");
            lblInfo       = (NXOpen.BlockStyler.Label)theDialog.TopBlock.FindBlock("lblInfo");
            tree          = (NXOpen.BlockStyler.Tree)theDialog.TopBlock.FindBlock("tree");
            lblHits       = (NXOpen.BlockStyler.Label)theDialog.TopBlock.FindBlock("lblHits");
            grpSelection1 = (NXOpen.BlockStyler.Group)theDialog.TopBlock.FindBlock("grpSelection1");
            lblBitmap     = (NXOpen.BlockStyler.Label)theDialog.TopBlock.FindBlock("lblBitmap");
            lblBitmapName = (NXOpen.BlockStyler.Label)theDialog.TopBlock.FindBlock("lblBitmapName");
            btnCopy       = (NXOpen.BlockStyler.Button)theDialog.TopBlock.FindBlock("btnCopy");
            //------------------------------------------------------------------------------
            //Registration of Treelist specific callbacks
            //------------------------------------------------------------------------------
            //tree.SetOnExpandHandler(new NXOpen.BlockStyler.Tree.OnExpandCallback(OnExpandCallback));

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

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

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

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

            //tree.SetOnSelectHandler(new NXOpen.BlockStyler.Tree.OnSelectCallback(OnSelectcallback));

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

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

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

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

            //tree.SetOnBeginLabelEditHandler(new NXOpen.BlockStyler.Tree.OnBeginLabelEditCallback(OnBeginLabelEditCallback));

            //tree.SetOnEndLabelEditHandler(new NXOpen.BlockStyler.Tree.OnEndLabelEditCallback(OnEndLabelEditCallback));

            //tree.SetOnEditOptionSelectedHandler(new NXOpen.BlockStyler.Tree.OnEditOptionSelectedCallback(OnEditOptionSelectedCallback));

            //tree.SetAskEditControlHandler(new NXOpen.BlockStyler.Tree.AskEditControlCallback(AskEditControlCallback));

            //tree.SetOnMenuHandler(new NXOpen.BlockStyler.Tree.OnMenuCallback(OnMenuCallback));;

            //tree.SetOnMenuSelectionHandler(new NXOpen.BlockStyler.Tree.OnMenuSelectionCallback(OnMenuSelectionCallback));;

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

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

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

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

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

            //------------------------------------------------------------------------------
            //------------------------------------------------------------------------------
            //Registration of StringBlock specific callbacks
            //------------------------------------------------------------------------------
            //strWildcard.SetKeystrokeCallback(new NXOpen.BlockStyler.StringBlock.KeystrokeCallback(KeystrokeCallback));

            //------------------------------------------------------------------------------

            names   = new List <String>(File.ReadAllLines(NamesFile));
            matches = new List <String>();
        }
        catch (Exception ex)
        {
            //---- Enter your exception handling code here -----
            theUI.NXMessageBox.Show("Block Styler", NXMessageBox.DialogType.Error, ex.ToString());
        }
    }