/// <summary> /// 创建阵列 /// </summary> private void CreatePattern(ElectrodePitchInfo pitch) { if ((pitch.PitchXNum > 1 && Math.Abs(pitch.PitchX) > 0) || (pitch.PitchYNum > 1 && Math.Abs(pitch.PitchY) > 0)) { CreateExpression(pitch); this.patternFeat = PatternUtils.CreatePattern("xNCopies", "xPitchDistance", "yNCopies", "yPitchDistance", this.matr, this.bodys.ToArray()); } }
/// <summary> /// 创建阵列 /// </summary> private void CreatePattern(double x, int xNumber, double y, int yNumber) { if ((xNumber > 1 && Math.Abs(x) > 0) || (yNumber > 1 && Math.Abs(y) > 0)) { CreateExpression(x, xNumber, y, yNumber); this.patternFeat = PatternUtils.CreatePattern("xNCopies", "xPitchDistance", "yNCopies", "yPitchDistance", this.HeadModel.ConditionModel.Work.WorkMatr, this.HeadModel.ConditionModel.Bodys.ToArray()); } }
/// <summary> /// 创建体特征 /// </summary> private void CreateBodyFeature(double zHeight) { List <Body> allbody = new List <Body>(); Matrix4 mat = new Matrix4(); mat.Identity(); foreach (Face face in GetMaxFaceForWave(waveBodys)) { PullFaceUtils.CreatePullFace(new Vector3d(0, 0, -1), zHeight, face); } NXOpen.Features.PatternGeometry patt = PatternUtils.CreatePattern(" xNCopies", "xPitchDistance", "yNCopies", " yPitchDistance" , mat, waveBodys); //创建阵列(就是绝对坐标的矩阵) allbody.AddRange(patt.GetAssociatedBodies()); allbody.AddRange(waveBodys); MoveObject.CreateMoveObjToXYZ("moveX", "moveY", "moveZ", null, allbody.ToArray()); }
public void CreatePatter() { if (this.double_x.Value == 0 && this.double_y.Value == 0) { return; } else { int coutx = 1; int conty = 1; if (double_x.Value != 0) { coutx = 2; } if (double_y.Value != 0) { conty = 2; } feature = PatternUtils.CreatePattern(coutx, double_x.Value, conty, double_y.Value, this.matr, feature, bodys.ToArray()); } }
private bool CreatWave() { Matrix4 mat = new Matrix4(); mat.Identity(); try { // Body[] waveBodys = AssmbliesUtils.WaveAssociativeBodys(this.headBodys.ToArray()).GetBodies(); PullFaceForWave(headBodys); NXOpen.Features.PatternGeometry patt = PatternUtils.CreatePattern(" xNCopies", "xPitchDistance", "yNCopies", " yPitchDistance" , mat, headBodys.ToArray()); //创建阵列(就是绝对坐标的矩阵) AllBodys.AddRange(patt.GetAssociatedBodies()); AllBodys.AddRange(headBodys); MoveObject.CreateMoveObjToXYZ("moveX", "moveY", "moveZ", null, AllBodys.ToArray()); SetHeadColour(); return(true); } catch (NXException ex) { ClassItem.WriteLogFile("创建Part档错误!" + ex.Message); return(false); } }