public static double H5 = 205, D51 = 200, L51 = 20, D52 = 245, L52 = 45, D53 = 100, L53 = 22.5, D54 = 122.5, L54 = 35; // Крышка public static void Build(InventorAPI api, string formName) { var oParameters = api.GetCompDef().Parameters; PlanarSketch[] sketch = new PlanarSketch[11]; Profile[] profile = new Profile[11]; SketchPoint[] point = new SketchPoint[10]; SketchLine[] line = new SketchLine[10]; SketchCircle[] circle = new SketchCircle[2]; ExtrudeFeature[] extrude = new ExtrudeFeature[10]; // Основание sketch[0] = api.Sketch(api.GetCompDef().WorkPlanes[2]); circle[0] = api.Circle(sketch[0], api.Point(sketch[0], 0, 0), D1 / 10 / 2); profile[0] = api.Profile(sketch[0]); extrude[0] = api.Extrude(profile[0], H1 / 10, 0, 0); sketch[1] = api.Sketch(extrude[0].Faces[3]); circle[0] = api.Circle(sketch[1], api.Point(sketch[1], 0, 0), D2 / 10 / 2); profile[1] = api.Profile(sketch[1]); extrude[1] = api.Extrude(profile[1], H2 / 10, 0, 0); // Кубическая часть корпуса sketch[2] = api.Sketch(extrude[1].Faces[2]); point[0] = api.Point(sketch[2], L2 / 10 / 2, L1 / 10 / 2); point[1] = api.Point(sketch[2], point[0].Geometry.X, -point[0].Geometry.Y); point[2] = api.Point(sketch[2], -point[0].Geometry.X, -point[0].Geometry.Y); point[3] = api.Point(sketch[2], -point[0].Geometry.X, point[0].Geometry.Y); line[0] = api.Line(sketch[2], point[0], point[1]); line[1] = api.Line(sketch[2], point[1], point[2]); line[2] = api.Line(sketch[2], point[2], point[3]); line[3] = api.Line(sketch[2], point[3], point[0]); profile[2] = api.Profile(sketch[2]); extrude[2] = api.Extrude(profile[2], T / 10, 0, 0); sketch[3] = api.Sketch(extrude[2].Faces[6]); point[0] = api.Point(sketch[3], L2 / 10 / 2, L1 / 10 / 2); point[1] = api.Point(sketch[3], point[0].Geometry.X, -point[0].Geometry.Y); point[2] = api.Point(sketch[3], -point[0].Geometry.X, -point[0].Geometry.Y); point[3] = api.Point(sketch[3], -point[0].Geometry.X, point[0].Geometry.Y); line[0] = api.Line(sketch[3], point[0], point[1]); line[1] = api.Line(sketch[3], point[1], point[2]); line[2] = api.Line(sketch[3], point[2], point[3]); line[3] = api.Line(sketch[3], point[3], point[0]); point[4] = api.Point(sketch[3], point[0].Geometry.X - T / 10, point[0].Geometry.Y - T / 10); point[5] = api.Point(sketch[3], point[0].Geometry.X - T / 10, -point[0].Geometry.Y + T / 10); point[6] = api.Point(sketch[3], -point[0].Geometry.X + T / 10, -point[0].Geometry.Y + T / 10); point[7] = api.Point(sketch[3], -point[0].Geometry.X + T / 10, point[0].Geometry.Y - T / 10); line[4] = api.Line(sketch[3], point[4], point[5]); line[5] = api.Line(sketch[3], point[5], point[6]); line[6] = api.Line(sketch[3], point[6], point[7]); line[7] = api.Line(sketch[3], point[7], point[4]); profile[3] = api.Profile(sketch[3]); extrude[3] = api.Extrude(profile[3], (HB - T * 2) / 10, 0, 0); var oWorkPlane4 = api.GetCompDef().WorkPlanes.AddByPlaneAndOffset(api.GetCompDef().WorkPlanes[2], (H1 + H2 + HB - T) / 10); oWorkPlane4.Visible = false; sketch[4] = api.Sketch(oWorkPlane4); point[0] = api.Point(sketch[4], L2 / 10 / 2, L1 / 10 / 2); point[1] = api.Point(sketch[4], point[0].Geometry.X, -point[0].Geometry.Y); point[2] = api.Point(sketch[4], -point[0].Geometry.X, -point[0].Geometry.Y); point[3] = api.Point(sketch[4], -point[0].Geometry.X, point[0].Geometry.Y); line[0] = api.Line(sketch[4], point[0], point[1]); line[1] = api.Line(sketch[4], point[1], point[2]); line[2] = api.Line(sketch[4], point[2], point[3]); line[3] = api.Line(sketch[4], point[3], point[0]); circle[0] = api.Circle(sketch[4], api.Point(sketch[4], 0, 0), D3 / 2 / 10); profile[4] = api.Profile(sketch[4]); extrude[4] = api.Extrude(profile[4], T / 10, 0, 0); // Переход к коническому корпусу sketch[5] = api.Sketch(extrude[4].Faces[3]); circle[0] = api.Circle(sketch[5], api.Point(sketch[5], 0, 0), D3 / 2 / 10); circle[1] = api.Circle(sketch[5], api.Point(sketch[5], 0, 0), (D3 / 2 + T) / 10); profile[5] = api.Profile(sketch[5]); extrude[5] = api.Extrude(profile[5], H3 / 10, 0, 0); // Отверстия у основания sketch[6] = api.Sketch(api.GetCompDef().WorkPlanes[2]); point[0] = api.Point(sketch[6], 0, 0); point[1] = api.Point(sketch[6], 0, DR / 2 / 10); point[2] = api.Point(sketch[6], DR / 2 / 10, 0); line[0] = api.Line(sketch[6], point[0], point[1]); line[1] = api.Line(sketch[6], point[0], point[2]); sketch[6].DimensionConstraints.AddTwoLineAngle(line[0], line[1], api.GetTransGeom().CreatePoint2d(1, 1)); sketch[6].GeometricConstraints.AddHorizontal((SketchEntity)line[1]); circle[0] = api.Circle(sketch[6], api.Point(sketch[6], DR / 10, -1), Or / 10); oParameters["d13"].Expression = "105 degree"; sketch[6].GeometricConstraints.AddCoincident((SketchEntity)circle[0].CenterSketchPoint, (SketchEntity)point[1]); profile[6] = api.Profile(sketch[6]); extrude[6] = api.Extrude(profile[6], H1 / 10, 0, 1); var objCollection = api.ObjectCollection(); objCollection.Add(extrude[6]); api.GetCompDef().Features.CircularPatternFeatures.Add(objCollection, api.GetCompDef().WorkAxes[2], true, 12, "360 degree", true, PatternComputeTypeEnum.kIdenticalCompute); // Трубки sketch[7] = api.Sketch(api.GetCompDef().WorkPlanes[1]); circle[0] = api.Circle(sketch[7], api.Point(sketch[7], H4 / 10, 0), D4D / 2 / 10); profile[7] = api.Profile(sketch[7]); extrude[7] = api.Extrude(profile[7], D3 / 10 + T * 2 / 10 + A * 2 / 10, 2, 0); sketch[8] = api.Sketch(api.GetCompDef().WorkPlanes[1]); circle[0] = api.Circle(sketch[8], api.Point(sketch[8], H4 / 10, 0), D4d / 2 / 10); profile[8] = api.Profile(sketch[8]); extrude[8] = api.Extrude(profile[8], D3 / 10 + T * 2 / 10 + A * 2 / 10, 2, 1); sketch[9] = api.Sketch(extrude[4].Faces[3]); circle[0] = api.Circle(sketch[9], api.Point(sketch[9], 0, 0), D3 / 2 / 10); profile[9] = api.Profile(sketch[9]); extrude[9] = api.Extrude(profile[9], H3, 0, 1); // Крышка sketch[10] = api.Sketch(api.GetCompDef().WorkPlanes[3]); point[0] = api.Point(sketch[10], L2 / 2 / 10, H5 / 10); point[1] = api.Point(sketch[10], point[0].Geometry.X, point[0].Geometry.Y + D51 / 2 / 10); point[2] = api.Point(sketch[10], point[1].Geometry.X + L51 / 10, point[1].Geometry.Y); point[3] = api.Point(sketch[10], point[2].Geometry.X, point[0].Geometry.Y + D52 / 2 / 10); point[4] = api.Point(sketch[10], point[3].Geometry.X + L52 / 10, point[3].Geometry.Y); point[5] = api.Point(sketch[10], point[4].Geometry.X, point[0].Geometry.Y + D53 / 2 / 10); point[6] = api.Point(sketch[10], point[5].Geometry.X + L53 / 10, point[5].Geometry.Y); point[7] = api.Point(sketch[10], point[6].Geometry.X, point[0].Geometry.Y + D54 / 2 / 10); point[8] = api.Point(sketch[10], point[7].Geometry.X + L54 / 10, point[7].Geometry.Y); point[9] = api.Point(sketch[10], point[8].Geometry.X, point[0].Geometry.Y); line[0] = api.Line(sketch[10], point[0], point[1]); line[1] = api.Line(sketch[10], point[1], point[2]); line[2] = api.Line(sketch[10], point[2], point[3]); line[3] = api.Line(sketch[10], point[3], point[4]); line[4] = api.Line(sketch[10], point[4], point[5]); line[5] = api.Line(sketch[10], point[5], point[6]); line[6] = api.Line(sketch[10], point[6], point[7]); line[7] = api.Line(sketch[10], point[7], point[8]); line[8] = api.Line(sketch[10], point[8], point[9]); line[9] = api.Line(sketch[10], point[9], point[0]); profile[10] = api.Profile(sketch[10]); api.Revolve(profile[10], line[9], 0); System.Windows.Forms.MessageBox.Show(formName + " завершено.", formName); }
public static void Build(InventorAPI api, string formName) { PlanarSketch[] sketch = new PlanarSketch[4]; Profile[] profile = new Profile[4]; SketchPoint[] point = new SketchPoint[5]; SketchLine[] line = new SketchLine[5]; SketchCircle[] circle = new SketchCircle[1]; ExtrudeFeature[] extrude = new ExtrudeFeature[4]; // Нижняя основа sketch[0] = api.Sketch(api.GetCompDef().WorkPlanes[3]); point[0] = api.Point(sketch[0], 0, 0); point[1] = api.Point(sketch[0], B / 10, 0); point[2] = api.Point(sketch[0], B / 10, -S1 / 10); point[3] = api.Point(sketch[0], 0, -S1 / 10); line[0] = api.Line(sketch[0], point[0], point[1]); line[1] = api.Line(sketch[0], point[1], point[2]); line[2] = api.Line(sketch[0], point[2], point[3]); line[3] = api.Line(sketch[0], point[3], point[0]); profile[0] = api.Profile(sketch[0]); extrude[0] = api.Extrude(profile[0], A1 / 10, 2, 0); // Боковые крепления var oWorkPlane1 = api.GetCompDef().WorkPlanes.AddByPlaneAndOffset(api.GetCompDef().WorkPlanes[3], A / 2 / 10); oWorkPlane1.Visible = false; sketch[1] = api.Sketch(oWorkPlane1); point[0] = api.Point(sketch[1], 0, 0); point[1] = api.Point(sketch[1], (B * System.Math.Sin(Parts.MainBody.Degree / 180 * System.Math.PI)) / 10, H * System.Math.Cos(Parts.MainBody.Degree / 180 * System.Math.PI) / 10 - S1 / 10); point[2] = api.Point(sketch[1], point[1].Geometry.X + K / 10, point[1].Geometry.Y); point[3] = api.Point(sketch[1], B / 10, K1 / 10); point[4] = api.Point(sketch[1], B / 10, 0); line[0] = api.Line(sketch[1], point[0], point[1]); line[1] = api.Line(sketch[1], point[1], point[2]); line[2] = api.Line(sketch[1], point[2], point[3]); line[3] = api.Line(sketch[1], point[3], point[4]); line[4] = api.Line(sketch[1], point[4], point[0]); profile[1] = api.Profile(sketch[1]); extrude[1] = api.Extrude(profile[1], S1 / 10, 0, 0); var objCollection1 = api.ObjectCollection(); objCollection1.Add(extrude[1]); api.GetCompDef().Features.MirrorFeatures.AddByDefinition(api.GetCompDef().Features.MirrorFeatures.CreateDefinition(objCollection1, api.GetCompDef().WorkPlanes[3], PatternComputeTypeEnum.kIdenticalCompute)); // Болтовое отверстие sketch[2] = api.Sketch(api.GetCompDef().WorkPlanes[3]); point[0] = api.Point(sketch[2], B / 10 - B1 / 10, -S1 / 10); point[1] = api.Point(sketch[2], point[0].Geometry.X + B2 / 10, point[0].Geometry.Y); point[2] = api.Point(sketch[2], point[1].Geometry.X, point[0].Geometry.Y - H1 / 10); point[3] = api.Point(sketch[2], point[0].Geometry.X, point[2].Geometry.Y); line[0] = api.Line(sketch[2], point[0], point[1]); line[1] = api.Line(sketch[2], point[1], point[2]); line[2] = api.Line(sketch[2], point[2], point[3]); line[3] = api.Line(sketch[2], point[3], point[0]); profile[2] = api.Profile(sketch[2]); extrude[2] = api.Extrude(profile[2], A2 / 10, 2, 0); sketch[3] = api.Sketch(api.GetCompDef().WorkPlanes[2]); circle[0] = api.Circle(sketch[3], api.Point(sketch[3], -(B / 10 - C / 10), 0), D6 / 2 / 10); profile[3] = api.Profile(sketch[3]); extrude[3] = api.Extrude(profile[3], H, 2, 1); // Резьба var EdgeCollection1 = api.EdgeCollection(); EdgeCollection1.Add(extrude[3].SideFaces[1].Edges[1]); var ThreadFeatures1 = api.ThreadFeatures(); var stInfo1 = ThreadFeatures1.CreateStandardThreadInfo(false, true, "ISO Metric profile", "M" + D6 + "x1.5", "6g"); ThreadFeatures1.Add(extrude[3].SideFaces[1], extrude[3].SideFaces[1].Edges[2], (ThreadInfo)stInfo1, false, true, 0); System.Windows.Forms.MessageBox.Show(formName + " завершено.", formName); }
public static void Build(InventorAPI api, string formName) { var oParameters = api.GetCompDef().Parameters; PlanarSketch[] sketch = new PlanarSketch[2]; Profile[] profile = new Profile[2]; SketchPoint[] point = new SketchPoint[8]; SketchLine[] line = new SketchLine[7]; SketchCircle[] circle = new SketchCircle[1]; // Создание конической основы sketch[0] = api.Sketch(api.GetCompDef().WorkPlanes[3]); point[0] = api.Point(sketch[0], 0.1, 0.1); point[1] = api.Point(sketch[0], 0.1, 0.2); line[0] = api.Line(sketch[0], point[0], point[1]); point[2] = api.Point(sketch[0], D / 2 - B, H); point[3] = api.Point(sketch[0], D / 2, H); point[4] = api.Point(sketch[0], D / 2, H - T); point[5] = api.Point(sketch[0], D / 2 - B + 1, H - T); point[6] = api.Point(sketch[0], Ds + 1, 0); point[7] = api.Point(sketch[0], Ds, 0); line[1] = api.Line(sketch[0], point[2], point[3]); line[2] = api.Line(sketch[0], point[3], point[4]); line[3] = api.Line(sketch[0], point[4], point[5]); line[4] = api.Line(sketch[0], point[5], point[6]); line[5] = api.Line(sketch[0], point[6], point[7]); line[6] = api.Line(sketch[0], point[7], point[2]); var SketchSize = api.GetTransGeom().CreatePoint2d(-1, -1); // Место для выноса размеров sketch[0].GeometricConstraints.AddVertical((SketchEntity)line[0]); sketch[0].GeometricConstraints.AddHorizontal((SketchEntity)line[1]); sketch[0].GeometricConstraints.AddVertical((SketchEntity)line[2]); sketch[0].GeometricConstraints.AddHorizontal((SketchEntity)line[3]); sketch[0].GeometricConstraints.AddHorizontal((SketchEntity)line[5]); sketch[0].GeometricConstraints.AddHorizontalAlign(point[0], point[7]); sketch[0].GeometricConstraints.AddParallel((SketchEntity)line[4], (SketchEntity)line[6]); sketch[0].DimensionConstraints.AddTwoPointDistance(point[0], point[7], DimensionOrientationEnum.kHorizontalDim, SketchSize); // Ds sketch[0].DimensionConstraints.AddTwoPointDistance(point[0], point[3], DimensionOrientationEnum.kVerticalDim, SketchSize); // H sketch[0].DimensionConstraints.AddTwoPointDistance(point[0], point[3], DimensionOrientationEnum.kHorizontalDim, SketchSize); // D sketch[0].DimensionConstraints.AddTwoPointDistance(point[2], point[3], DimensionOrientationEnum.kHorizontalDim, SketchSize); // B sketch[0].DimensionConstraints.AddOffset(line[4], (SketchEntity)line[6], SketchSize, false); // A sketch[0].DimensionConstraints.AddTwoPointDistance(point[3], point[4], DimensionOrientationEnum.kVerticalDim, SketchSize); // T oParameters["d0"].Expression = Ds / 2 + " mm"; oParameters["d1"].Expression = H + " mm"; oParameters["d2"].Expression = D / 2 + " mm"; oParameters["d3"].Expression = B + " mm"; oParameters["d4"].Expression = A + " mm"; oParameters["d5"].Expression = T + " mm"; point[0].MoveTo(api.GetTransGeom().CreatePoint2d(0, 0)); // Выравнивание осевой линии центра sketch[0].DimensionConstraints.AddTwoLineAngle(line[6], line[0], api.GetTransGeom().CreatePoint2d(10, 40), true); Degree = oParameters["d6"]._Value * (180 / System.Math.PI); profile[0] = api.Profile(sketch[0]); api.Revolve(profile[0], line[0], 0); // Отверстия sketch[1] = api.Sketch(api.GetCompDef().WorkPlanes[2]); point[0] = api.Point(sketch[1], 0, Rb / 10); circle[0] = api.Circle(sketch[1], point[0], Rm / 10 / 2); profile[1] = api.Profile(sketch[1]); var extrude = api.Extrude(profile[1], H / 10, 0, 1); var objCollection2 = api.ObjectCollection(); objCollection2.Add(extrude); api.GetCompDef().Features.CircularPatternFeatures.Add(objCollection2, api.GetCompDef().WorkAxes[2], true, 3, "360 degree", true, PatternComputeTypeEnum.kIdenticalCompute); System.Windows.Forms.MessageBox.Show(formName + " завершено.", formName); }
public static void Build(InventorAPI api, string formName) { PlanarSketch[] sketch = new PlanarSketch[4]; Profile[] profile = new Profile[4]; SketchPoint[] point = new SketchPoint[4]; SketchLine[] line = new SketchLine[4]; RevolveFeature[] revolve = new RevolveFeature[4]; // Создание цилиндра sketch[0] = api.Sketch(api.GetCompDef().WorkPlanes[3]); point[0] = api.Point(sketch[0], 0, 0); point[1] = api.Point(sketch[0], 0, H / 10); point[2] = api.Point(sketch[0], D1 / 10 / 2, H / 10); point[3] = api.Point(sketch[0], D1 / 10 / 2, 0); line[0] = api.Line(sketch[0], point[0], point[1]); line[1] = api.Line(sketch[0], point[1], point[2]); line[2] = api.Line(sketch[0], point[2], point[3]); line[3] = api.Line(sketch[0], point[3], point[0]); profile[0] = api.Profile(sketch[0]); revolve[0] = api.Revolve(profile[0], line[0], 0); // Создание пружины sketch[1] = api.Sketch(api.GetCompDef().WorkPlanes[3]); point[0] = api.Point(sketch[1], D1 / 10 / 2, 0); point[1] = api.Point(sketch[1], D / 10 / 2, 0); point[3] = api.Point(sketch[1], D1 / 10 / 2, T / 10); line[0] = api.Line(sketch[1], point[0], point[1]); line[1] = api.Line(sketch[1], point[1], point[3]); line[2] = api.Line(sketch[1], point[3], point[0]); profile[1] = api.Profile(sketch[1]); var coil = api.GetCompDef().Features.CoilFeatures.AddByPitchAndHeight(profile[1], api.GetCompDef().WorkAxes[2], H1 / 10, H2 / 10, PartFeatureOperationEnum.kJoinOperation, false, false, 0, false, 0, 0, true); // Верхняя граница пружины sketch[2] = api.Sketch(api.GetCompDef().WorkPlanes[3]); point[0] = api.Point(sketch[2], 0, H2 / 10); point[1] = api.Point(sketch[2], 0, H2 / 10 + T / 10); point[2] = api.Point(sketch[2], D / 10 / 2, H2 / 10 + T / 10); point[3] = api.Point(sketch[2], D / 10 / 2, H2 / 10); line[0] = api.Line(sketch[2], point[0], point[1]); line[1] = api.Line(sketch[2], point[1], point[2]); line[2] = api.Line(sketch[2], point[2], point[3]); line[3] = api.Line(sketch[2], point[3], point[0]); profile[2] = api.Profile(sketch[2]); revolve[2] = api.Revolve(profile[2], line[0], 0); // Крепление sketch[3] = api.Sketch(api.GetCompDef().WorkPlanes[3]); point[0] = api.Point(sketch[3], 0, H3 / 10); point[1] = api.Point(sketch[3], 0, H3 / 10 + A / 10); point[2] = api.Point(sketch[3], D / 10 / 2, H3 / 10 + A / 10); point[3] = api.Point(sketch[3], D / 10 / 2, H3 / 10); line[0] = api.Line(sketch[3], point[0], point[1]); line[1] = api.Line(sketch[3], point[1], point[2]); line[2] = api.Line(sketch[3], point[2], point[3]); line[3] = api.Line(sketch[3], point[3], point[0]); profile[3] = api.Profile(sketch[3]); revolve[3] = api.Revolve(profile[3], line[0], 0); System.Windows.Forms.MessageBox.Show(formName + " завершено.", formName); }
public static double D1R = 380, D1r = 260, T1R = 240, O1r = 22, O1R = 168, R1R = 540; // Загрузка сыпучих материалов public static void Build(InventorAPI api, string formName) { var oParameters = api.GetCompDef().Parameters; PlanarSketch[] sketch = new PlanarSketch[12]; Profile[] profile = new Profile[12]; SketchPoint[] point = new SketchPoint[8]; SketchLine[] line = new SketchLine[8]; SketchCircle[] circle = new SketchCircle[1]; ExtrudeFeature[] extrude = new ExtrudeFeature[12]; // Основа корпуса sketch[0] = api.Sketch(api.GetCompDef().WorkPlanes[3]); point[0] = api.Point(sketch[0], 0, H / 10 - T / 10); point[1] = api.Point(sketch[0], 0, H / 10); point[2] = api.Point(sketch[0], D1 / 10 / 2, H / 10); point[3] = api.Point(sketch[0], D1 / 10 / 2, T / 10); point[4] = api.Point(sketch[0], D / 10 / 2, T / 10); point[5] = api.Point(sketch[0], D / 10 / 2, 0); point[6] = api.Point(sketch[0], D1 / 10 / 2 - T / 10, 0); point[7] = api.Point(sketch[0], D1 / 10 / 2 - T / 10, H / 10 - T / 10); line[0] = api.Line(sketch[0], point[0], point[1]); line[1] = api.Line(sketch[0], point[1], point[2]); line[2] = api.Line(sketch[0], point[2], point[3]); line[3] = api.Line(sketch[0], point[3], point[4]); line[4] = api.Line(sketch[0], point[4], point[5]); line[5] = api.Line(sketch[0], point[5], point[6]); line[6] = api.Line(sketch[0], point[6], point[7]); line[7] = api.Line(sketch[0], point[7], point[0]); profile[0] = api.Profile(sketch[0]); api.Revolve(profile[0], line[0], 0); // Ребра жесткости sketch[1] = api.Sketch(api.GetCompDef().WorkPlanes[3]); point[0] = api.Point(sketch[1], D1 / 10 / 2 - T / 10, H / 10); point[1] = api.Point(sketch[1], point[0].Geometry.X + T / 10 * 2, H / 10); point[2] = api.Point(sketch[1], D / 10 / 2, T / 10 * 2); point[3] = api.Point(sketch[1], D / 10 / 2, T / 10); point[4] = api.Point(sketch[1], point[0].Geometry.X, T / 10); line[0] = api.Line(sketch[1], point[0], point[1]); line[0] = api.Line(sketch[1], point[1], point[2]); line[0] = api.Line(sketch[1], point[2], point[3]); line[0] = api.Line(sketch[1], point[3], point[4]); line[0] = api.Line(sketch[1], point[4], point[0]); profile[1] = api.Profile(sketch[1]); extrude[1] = api.Extrude(profile[1], A / 10, 2, 0); var objCollection1 = api.ObjectCollection(); objCollection1.Add(extrude[1]); api.GetCompDef().Features.CircularPatternFeatures.Add(objCollection1, api.GetCompDef().WorkAxes[2], true, ACount, "360 degree", true, PatternComputeTypeEnum.kIdenticalCompute); // Резервные проходы (2 штуки) var oWorkPlane2 = api.GetCompDef().WorkPlanes.AddByPlaneAndOffset(api.GetCompDef().WorkPlanes[2], HR / 10); oWorkPlane2.Visible = false; sketch[2] = api.Sketch(oWorkPlane2); circle[0] = api.Circle(sketch[2], api.Point(sketch[2], RR / 10, 0), DR / 10 / 2); profile[2] = api.Profile(sketch[2]); extrude[2] = api.Extrude(profile[2], Hr / 10, 2, 0); sketch[3] = api.Sketch(oWorkPlane2); circle[0] = api.Circle(sketch[3], api.Point(sketch[3], RR / 10, 0), Dr / 10 / 2); profile[3] = api.Profile(sketch[3]); extrude[3] = api.Extrude(profile[3], HR / 10 - H / 10, 1, 0); sketch[4] = api.Sketch(oWorkPlane2); circle[0] = api.Circle(sketch[4], api.Point(sketch[4], RR / 10, 0), TR / 10 / 2); profile[4] = api.Profile(sketch[4]); extrude[4] = api.Extrude(profile[4], 10000, 2, 1); sketch[5] = api.GetCompDef().Sketches.Add(oWorkPlane2); sketch[5] = api.Sketch(oWorkPlane2); circle[0] = api.Circle(sketch[5], api.Point(sketch[5], RR / 10, OR / 10), Or / 10 / 2); profile[5] = api.Profile(sketch[5]); extrude[5] = api.Extrude(profile[5], Hr / 10, 2, 1); var Axis5 = api.GetCompDef().WorkAxes.AddByRevolvedFace(extrude[4].Faces[1]); Axis5.Visible = false; var objCollection5 = api.ObjectCollection(); objCollection5.Add(extrude[5]); var CircularPatternFeature5 = api.GetCompDef().Features.CircularPatternFeatures.Add(objCollection5, Axis5, true, 8, "360 degree", true, PatternComputeTypeEnum.kIdenticalCompute); var objCollection6 = api.ObjectCollection(); for (int i = 2; i < 6; i++) { objCollection6.Add(extrude[i]); } objCollection6.Add(CircularPatternFeature5); api.GetCompDef().Features.CircularPatternFeatures.Add(objCollection6, api.GetCompDef().WorkAxes[2], true, 2, "150 degree", true, PatternComputeTypeEnum.kIdenticalCompute); // Отверстия под болты sketch[7] = api.Sketch(api.GetCompDef().WorkPlanes[2]); point[0] = api.Point(sketch[7], 0, 0); point[1] = api.Point(sketch[7], 0, MBRb / 10); point[2] = api.Point(sketch[7], MBRb / 10, 0); line[0] = api.Line(sketch[7], point[1], point[0]); line[1] = api.Line(sketch[7], point[0], point[2]); sketch[7].DimensionConstraints.AddTwoLineAngle(line[0], line[1], api.GetTransGeom().CreatePoint2d(1, 1)); sketch[7].GeometricConstraints.AddHorizontal((SketchEntity)line[1]); circle[0] = api.Circle(sketch[7], point[1], MBRm / 10 / 2); oParameters["d21"].Expression = "82.5 degree"; sketch[7].GeometricConstraints.AddCoincident((SketchEntity)circle[0].CenterSketchPoint, (SketchEntity)point[1]); profile[7] = api.Profile(sketch[7]); extrude[7] = api.Extrude(profile[7], 10000, 2, 1); var objCollection7 = api.ObjectCollection(); objCollection7.Add(extrude[7]); api.GetCompDef().Features.CircularPatternFeatures.Add(objCollection7, api.GetCompDef().WorkAxes[2], true, 3, "360 degree", true, PatternComputeTypeEnum.kIdenticalCompute); // Загрузка сыпучих материалов sketch[8] = api.Sketch(oWorkPlane2); point[0] = api.Point(sketch[8], 0, 0); point[1] = api.Point(sketch[8], 0, -R1R / 10); point[2] = api.Point(sketch[8], -R1R / 10, 0); line[0] = api.Line(sketch[8], point[0], point[1]); line[1] = api.Line(sketch[8], point[0], point[2]); sketch[8].DimensionConstraints.AddTwoLineAngle(line[0], line[1], api.GetTransGeom().CreatePoint2d(1, 1)); sketch[8].GeometricConstraints.AddVertical((SketchEntity)line[0]); circle[0] = api.Circle(sketch[8], api.Point(sketch[8], -R1R / 10, -1), D1R / 10 / 2); oParameters["d27"].Expression = "75 degree"; sketch[8].GeometricConstraints.AddCoincident((SketchEntity)circle[0].CenterSketchPoint, (SketchEntity)point[2]); profile[8] = api.Profile(sketch[8]); extrude[8] = api.Extrude(profile[8], Hr / 10, 2, 0); sketch[9] = api.Sketch(extrude[8].Faces[1]); circle[0] = api.Circle(sketch[9], api.Point(sketch[9], 0, 0), D1r / 10 / 2); profile[9] = api.Profile(sketch[9]); extrude[9] = api.Extrude(profile[9], HR / 10 - H / 10, 0, 0); sketch[10] = api.Sketch(extrude[8].Faces[1]); circle[0] = api.Circle(sketch[10], api.Point(sketch[10], 0, 0), T1R / 10 / 2); profile[10] = api.Profile(sketch[10]); extrude[10] = api.Extrude(profile[10], 10000, 2, 1); sketch[11] = api.Sketch(extrude[8].Faces[1]); circle[0] = api.Circle(sketch[11], api.Point(sketch[11], 0, O1R / 10), O1r / 10 / 2); profile[11] = api.Profile(sketch[11]); extrude[11] = api.Extrude(profile[11], Hr / 10, 1, 1); var Axis11 = api.GetCompDef().WorkAxes.AddByRevolvedFace(extrude[10].Faces[1]); Axis11.Visible = false; var objCollection11 = api.ObjectCollection(); objCollection11.Add(extrude[11]); api.GetCompDef().Features.CircularPatternFeatures.Add(objCollection11, Axis11, true, 12, "360 degree", true, PatternComputeTypeEnum.kIdenticalCompute); System.Windows.Forms.MessageBox.Show(formName + " завершено.", formName); }