//------------------------------------------------------------------------------ //---------------------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()); } }
/// <summary> /// 关联线性向量到体面上 /// </summary> /// <param name="ld">控件</param /// <param name="vec">向量</param> public abstract void SetDimForFace(ref NXOpen.BlockStyler.LinearDimension ld, Vector3d vec);