/// <summary> /// 设置面铣边界 /// </summary> /// <param name="toolside"></param> /// <param name="pt"></param> /// <param name="boundary"></param> /// <param name="edges"></param> public static BoundaryMillingSet CreateBoundaryMillingSet(BoundarySet.ToolSideTypes toolside, BoundarySet.BoundaryTypes types, Point3d pt, Boundary boundary, params Edge[] edges) { Matrix4 mat = new Matrix4(); mat.Identity(); Part workPart = Session.GetSession().Parts.Work; BoundaryMillingSet boundarySet; boundarySet = boundary.CreateBoundaryMillingSet(); boundarySet.ToolSide = toolside; boundarySet.PlaneType = NXOpen.CAM.BoundarySet.PlaneTypes.UserDefined; boundarySet.AppendCurves(edges, pt, mat.GetMatrix3()); boundarySet.BoundaryType = types; return(boundarySet); }
/// <summary> /// 设置面铣边界(以绝对点) /// </summary> /// <param name="toolside">刀具侧</param> /// <param name="types"></param> /// <param name="pt">封闭还是开放</param> /// <param name="boundary">边界</param> /// <param name="edges">边</param> public static BoundaryMillingSet CreateBoundaryMillingSet(BoundarySet.ToolSideTypes toolside, BoundarySet.BoundaryTypes types, Point3d pt, Boundary boundary, params NXObject[] edges) { if (boundary == null) { throw new Exception("输入边界为空!"); } if (edges.Length == 0) { throw new Exception("输入边为空!"); } Matrix4 mat = new Matrix4(); mat.Identity(); Part workPart = Session.GetSession().Parts.Work; BoundaryMillingSet boundarySet; boundarySet = boundary.CreateBoundaryMillingSet(); boundarySet.ToolSide = toolside; boundarySet.PlaneType = NXOpen.CAM.BoundarySet.PlaneTypes.UserDefined; boundarySet.AppendCurves(edges, pt, mat.GetMatrix3()); boundarySet.BoundaryType = types; return(boundarySet); }