//------------------------------------------------------------------------------ //Callback Name: initialize_cb //------------------------------------------------------------------------------ public void initialize_cb() { try { group0 = (NXOpen.BlockStyler.Group)theDialog.TopBlock.FindBlock("group0"); SeleElePart = (NXOpen.BlockStyler.SelectObject)theDialog.TopBlock.FindBlock("SeleElePart"); StrName = (NXOpen.BlockStyler.StringBlock)theDialog.TopBlock.FindBlock("StrName"); group = (NXOpen.BlockStyler.Group)theDialog.TopBlock.FindBlock("group"); double_x = (NXOpen.BlockStyler.DoubleBlock)theDialog.TopBlock.FindBlock("double_x"); double_y = (NXOpen.BlockStyler.DoubleBlock)theDialog.TopBlock.FindBlock("double_y"); double_z = (NXOpen.BlockStyler.DoubleBlock)theDialog.TopBlock.FindBlock("double_z"); Selection.MaskTriple maskComp = new Selection.MaskTriple() { Type = 63, Subtype = 1, SolidBodySubtype = 0 }; Selection.MaskTriple[] masks = { maskComp }; SeleElePart.SetSelectionFilter(Selection.SelectionAction.ClearAndEnableSpecific, masks);//过滤只选择组件 } catch (Exception ex) { //---- Enter your exception handling code here ----- theUI.NXMessageBox.Show("Block Styler", NXMessageBox.DialogType.Error, ex.ToString()); } }
//------------------------------------------------------------------------------ //---------------------Block UI Styler Callback Functions-------------------------- //------------------------------------------------------------------------------ //------------------------------------------------------------------------------ //Callback Name: initialize_cb //------------------------------------------------------------------------------ public void initialize_cb() { try { group0 = (NXOpen.BlockStyler.Group)theDialog.TopBlock.FindBlock("group0"); selectionBody = (NXOpen.BlockStyler.SelectObject)theDialog.TopBlock.FindBlock("selectionBody"); group2 = (NXOpen.BlockStyler.Group)theDialog.TopBlock.FindBlock("group2"); get_point = (NXOpen.BlockStyler.SelectObject)theDialog.TopBlock.FindBlock("get_point"); group = (NXOpen.BlockStyler.Group)theDialog.TopBlock.FindBlock("group"); rotation_x = (NXOpen.BlockStyler.Button)theDialog.TopBlock.FindBlock("rotation_x"); rotation_y = (NXOpen.BlockStyler.Button)theDialog.TopBlock.FindBlock("rotation_y"); rotation_z = (NXOpen.BlockStyler.Button)theDialog.TopBlock.FindBlock("rotation_z"); //get_point.SelectModeAsString = "Multiple"; Selection.MaskTriple maskFace = new Selection.MaskTriple() { Type = 70, Subtype = 2, SolidBodySubtype = 20 }; Selection.MaskTriple maskPoint = new Selection.MaskTriple() { Type = 2, Subtype = 0, SolidBodySubtype = 0 }; Selection.MaskTriple[] masks = { maskFace, maskPoint }; get_point.SetSelectionFilter(Selection.SelectionAction.ClearAndEnableSpecific, masks);//过滤只选择点和面 } catch (Exception ex) { //---- Enter your exception handling code here ----- theUI.NXMessageBox.Show("Block Styler", NXMessageBox.DialogType.Error, ex.ToString()); } }
//------------------------------------------------------------------------------ //---------------------Block UI Styler Callback Functions-------------------------- //------------------------------------------------------------------------------ //------------------------------------------------------------------------------ //Callback Name: initialize_cb //------------------------------------------------------------------------------ public void initialize_cb() { try { group0 = (NXOpen.BlockStyler.Group)theDialog.TopBlock.FindBlock("group0"); seleComp = (NXOpen.BlockStyler.SelectObject)theDialog.TopBlock.FindBlock("seleComp"); groupWorkpiece = (NXOpen.BlockStyler.Group)theDialog.TopBlock.FindBlock("groupWorkpiece"); strMoldNumber = (NXOpen.BlockStyler.StringBlock)theDialog.TopBlock.FindBlock("strMoldNumber"); strWorkpieceNumber = (NXOpen.BlockStyler.StringBlock)theDialog.TopBlock.FindBlock("strWorkpieceNumber"); strEditionNumber = (NXOpen.BlockStyler.StringBlock)theDialog.TopBlock.FindBlock("strEditionNumber"); groupEle = (NXOpen.BlockStyler.Group)theDialog.TopBlock.FindBlock("groupEle"); strEleName = (NXOpen.BlockStyler.StringBlock)theDialog.TopBlock.FindBlock("strEleName"); strEleName1 = (NXOpen.BlockStyler.StringBlock)theDialog.TopBlock.FindBlock("strEleName1"); strEleEditionNumber = (NXOpen.BlockStyler.StringBlock)theDialog.TopBlock.FindBlock("strEleEditionNumber"); groupWork = (NXOpen.BlockStyler.Group)theDialog.TopBlock.FindBlock("groupWork"); intWorkNumber = (NXOpen.BlockStyler.IntegerBlock)theDialog.TopBlock.FindBlock("intWorkNumber"); Selection.MaskTriple maskComp = new Selection.MaskTriple() { Type = 63, Subtype = 1, SolidBodySubtype = 0 }; Selection.MaskTriple[] masks = { maskComp }; seleComp.SetSelectionFilter(Selection.SelectionAction.ClearAndEnableSpecific, masks);//过滤只选择组件 } catch (Exception ex) { //---- Enter your exception handling code here ----- theUI.NXMessageBox.Show("Block Styler", NXMessageBox.DialogType.Error, ex.ToString()); } }
//------------------------------------------------------------------------------ //---------------------Block UI Styler Callback Functions-------------------------- //------------------------------------------------------------------------------ //------------------------------------------------------------------------------ //Callback Name: initialize_cb //------------------------------------------------------------------------------ public void initialize_cb() { try { group0 = (NXOpen.BlockStyler.Group)theDialog.TopBlock.FindBlock("group0"); SeleElePart = (NXOpen.BlockStyler.SelectObject)theDialog.TopBlock.FindBlock("SeleElePart"); group = (NXOpen.BlockStyler.Group)theDialog.TopBlock.FindBlock("group"); double_x = (NXOpen.BlockStyler.DoubleBlock)theDialog.TopBlock.FindBlock("double_x"); butt_x = (NXOpen.BlockStyler.Button)theDialog.TopBlock.FindBlock("butt_x"); double_y = (NXOpen.BlockStyler.DoubleBlock)theDialog.TopBlock.FindBlock("double_y"); butt_y = (NXOpen.BlockStyler.Button)theDialog.TopBlock.FindBlock("butt_y"); Selection.MaskTriple maskBody = new Selection.MaskTriple() //面 { Type = 70, Subtype = 0, SolidBodySubtype = UFConstants.UF_UI_SEL_FEATURE_BODY }; Selection.MaskTriple[] masks = { maskBody }; this.SeleElePart.SetSelectionFilter(Selection.SelectionAction.ClearAndEnableSpecific, masks); this.bodys.Clear(); this.feature = null; } catch (Exception ex) { //---- Enter your exception handling code here ----- theUI.NXMessageBox.Show("Block Styler", NXMessageBox.DialogType.Error, ex.ToString()); } }
//------------------------------------------------------------------------------ //---------------------Block UI Styler Callback Functions-------------------------- //------------------------------------------------------------------------------ //------------------------------------------------------------------------------ //Callback Name: initialize_cb //------------------------------------------------------------------------------ public void initialize_cb() { try { group = (NXOpen.BlockStyler.Group)theDialog.TopBlock.FindBlock("group"); seleComp = (NXOpen.BlockStyler.SelectObject)theDialog.TopBlock.FindBlock("seleComp"); group0 = (NXOpen.BlockStyler.Group)theDialog.TopBlock.FindBlock("group0"); MoldNumber = (NXOpen.BlockStyler.StringBlock)theDialog.TopBlock.FindBlock("MoldNumber"); PartNumber = (NXOpen.BlockStyler.StringBlock)theDialog.TopBlock.FindBlock("PartNumber"); EditionNumber = (NXOpen.BlockStyler.StringBlock)theDialog.TopBlock.FindBlock("EditionNumber"); ClientNumber = (NXOpen.BlockStyler.StringBlock)theDialog.TopBlock.FindBlock("ClientNumber"); enum0 = (NXOpen.BlockStyler.Enumeration)theDialog.TopBlock.FindBlock("enum0"); Selection.MaskTriple maskComp = new Selection.MaskTriple() { Type = 63, Subtype = 1, SolidBodySubtype = 0 }; Selection.MaskTriple[] masks = { maskComp }; seleComp.SetSelectionFilter(Selection.SelectionAction.ClearAndEnableSpecific, masks);//过滤只选择组件 } catch (Exception ex) { //---- Enter your exception handling code here ----- theUI.NXMessageBox.Show("Block Styler", NXMessageBox.DialogType.Error, ex.ToString()); } }
//------------------------------------------------------------------------------ //---------------------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"); 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()); } }
//------------------------------------------------------------------------------ //---------------------Block UI Styler Callback Functions-------------------------- //------------------------------------------------------------------------------ //------------------------------------------------------------------------------ //Callback Name: initialize_cb //------------------------------------------------------------------------------ public void initialize_cb() { try { groupPart = (NXOpen.BlockStyler.Group)theDialog.TopBlock.FindBlock("groupPart"); selePart = (NXOpen.BlockStyler.SelectObject)theDialog.TopBlock.FindBlock("selePart"); group = (NXOpen.BlockStyler.Group)theDialog.TopBlock.FindBlock("group"); addOrModify = (NXOpen.BlockStyler.Toggle)theDialog.TopBlock.FindBlock("addOrModify"); workNumber = (NXOpen.BlockStyler.Enumeration)theDialog.TopBlock.FindBlock("workNumber"); group2 = (NXOpen.BlockStyler.Group)theDialog.TopBlock.FindBlock("group2"); selePoint = (NXOpen.BlockStyler.SelectObject)theDialog.TopBlock.FindBlock("selePoint"); group1 = (NXOpen.BlockStyler.Group)theDialog.TopBlock.FindBlock("group1"); button_X = (NXOpen.BlockStyler.Button)theDialog.TopBlock.FindBlock("button_X"); button_Z = (NXOpen.BlockStyler.Button)theDialog.TopBlock.FindBlock("button_Z"); button_Y = (NXOpen.BlockStyler.Button)theDialog.TopBlock.FindBlock("button_Y"); addOrModify = (NXOpen.BlockStyler.Toggle)theDialog.TopBlock.FindBlock("addOrModify"); workNumber = (NXOpen.BlockStyler.Enumeration)theDialog.TopBlock.FindBlock("workNumber"); #region 过滤 Selection.MaskTriple maskComp = new Selection.MaskTriple() { Type = 63, Subtype = 1, SolidBodySubtype = 0 }; Selection.MaskTriple[] masks = { maskComp }; selePart.SetSelectionFilter(Selection.SelectionAction.ClearAndEnableSpecific, masks);//过滤只选择组件 Selection.MaskTriple maskFace = new Selection.MaskTriple() { Type = 70, Subtype = 2, SolidBodySubtype = 20 }; Selection.MaskTriple maskPoint = new Selection.MaskTriple() { Type = 2, Subtype = 0, SolidBodySubtype = 0 }; Selection.MaskTriple[] masks1 = { maskFace, maskPoint }; selePoint.SetSelectionFilter(Selection.SelectionAction.ClearAndEnableSpecific, masks1);//过滤只选择点和面 #endregion } catch (Exception ex) { //---- Enter your exception handling code here ----- theUI.NXMessageBox.Show("Block Styler", NXMessageBox.DialogType.Error, ex.ToString()); } }
//------------------------------------------------------------------------------ //---------------------Block UI Styler Callback Functions-------------------------- //------------------------------------------------------------------------------ //------------------------------------------------------------------------------ //Callback Name: initialize_cb //------------------------------------------------------------------------------ public void initialize_cb() { try { Group = (NXOpen.BlockStyler.Group)theDialog.TopBlock.FindBlock("Group"); Selection = (NXOpen.BlockStyler.SelectObject)theDialog.TopBlock.FindBlock("Selection"); Group1 = (NXOpen.BlockStyler.Group)theDialog.TopBlock.FindBlock("Group1"); Selection1 = (NXOpen.BlockStyler.SelectObject)theDialog.TopBlock.FindBlock("Selection1"); Selection.MaskTriple maskBody = new Selection.MaskTriple() //面 { Type = 70, Subtype = 0, SolidBodySubtype = UFConstants.UF_UI_SEL_FEATURE_BODY }; Selection.MaskTriple[] masks = { maskBody }; this.Selection.SetSelectionFilter(NXOpen.Selection.SelectionAction.ClearAndEnableSpecific, masks); this.Selection1.SetSelectionFilter(NXOpen.Selection.SelectionAction.ClearAndEnableSpecific, masks); } catch (Exception ex) { //---- Enter your exception handling code here ----- theUI.NXMessageBox.Show("Block Styler", NXMessageBox.DialogType.Error, ex.ToString()); } }
//------------------------------------------------------------------------------ //---------------------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()); } }