private void backWing(AssemblyParameters parameters) { var Part = swDoc; //double heightOfSpoiler = 198.0; double heightOfSpoiler = parameters.SpoilerVerticalPosition; Part.ClearSelection2(true); Part.InsertSketch(); // Line for direction Part.Extension.SelectByID2("", "FACE", -300 / 100.0, 0.04, widthOfMainPart / 2.0, false, 0, null, 0); Part.SketchManager.CreateLine(-337.10445637 / 100.0, 0, 0, -285.49601322 / 100.0, 80.0 / 100.0, 0); Part.ClearSelection2(true); Part.InsertSketch(); Part.Extension.SelectByID2("", "FACE", -0.7471, 0.5085, -0.3293, false, 0, null, 0); Part.SketchManager.CreateLine(19.2685305 / 100.0, 80.0 / 100.0, 0, 57.69612755 / 100.0, 0, 0); Part.ClearSelection2(true); Part.InsertSketch(); Part.Extension.SelectByID2("", "FACE", -0.4259, 0, 0.9371, false, 0, null, 0); Part.SketchManager.CreateSketchSlot((int)swSketchSlotCreationType_e.swSketchSlotCreationType_center_line, (int)swSketchSlotLengthType_e.swSketchSlotLengthType_CenterCenter, 0.128689376070244, -0.4078, -1.00, 0, -0.264120136634895, -1.00, 0, 0, 0, 0, 1, false); Part.ClearSelection2(true); Part.Extension.SelectByID2("", "FACE", -0.5415, 0, -1.1320, false, 0, null, 0); Part.SketchManager.CreateSketchSlot((int)swSketchSlotCreationType_e.swSketchSlotCreationType_center_line, (int)swSketchSlotLengthType_e.swSketchSlotLengthType_CenterCenter, 0.128689376070244, -0.4078, 1.00, 0, -0.264120136634895, 1.0, 0, 0, 0, 0, 1, false); Part.Extension.SelectByID2("Line1@Sketch11", "EXTSKETCHSEGMENT", -323.55282659 / 100.0, 21.00684144 / 100.0, widthOfMainPart / 2.0, true, 16, null, 0); Part.FeatureManager.FeatureExtrusion2(true, false, true, 0, 0, heightOfSpoiler / 100.0, 0.01, false, false, false, false, 1.74532925199433E-02, 1.74532925199433E-02, false, false, false, false, true, true, true, 0, 0, false); Part.ClearSelection2(true); Part.InsertSketch(); //double lengthOfSpoiler = 500; //double widthOfSpoiler = 70; //double heightOfSpoilerWing = 30 / 100.0; double lengthOfSpoiler = parameters.SpoilerLength; double widthOfSpoiler = parameters.SpoilerWidth; double heightOfSpoilerWing = parameters.SpoilerThickness / 100.0; double xCooficient = 198.0 / 107.34; double yCooficient = 198.0 / 166.38; double xForSelectTopFace = (-55.15 / 100.0) + (heightOfSpoiler / xCooficient) / 100.0; double yForSelectTopFace = 0.0 + (heightOfSpoiler / yCooficient) / 100.0; double zForSelectTopFace = -93.57 / 100.0 - 0.5 / 100.0; Part.Extension.SelectByID2("", "FACE", xForSelectTopFace, yForSelectTopFace, zForSelectTopFace, false, 0, null, 0); Part.SketchManager.CreateLine(xForSelectTopFace - 0.07, (lengthOfSpoiler / 2) / 100, 0, (xForSelectTopFace - 0.07), (-lengthOfSpoiler / 2) / 100, 0); Part.SketchManager.CreateLine(xForSelectTopFace - 0.07, (-lengthOfSpoiler / 2) / 100, 0, (xForSelectTopFace - 0.07) + (widthOfSpoiler) / 100, (-lengthOfSpoiler / 2) / 100, 0); Part.SketchManager.CreateLine((xForSelectTopFace - 0.07) + (widthOfSpoiler) / 100, (-lengthOfSpoiler / 2) / 100, 0, (xForSelectTopFace - 0.07) + (widthOfSpoiler) / 100, (lengthOfSpoiler / 2) / 100, 0); Part.SketchManager.CreateLine((xForSelectTopFace - 0.07) + (widthOfSpoiler) / 100, (lengthOfSpoiler / 2) / 100, 0, (xForSelectTopFace - 0.07), (lengthOfSpoiler / 2) / 100, 0); Part.FeatureManager.FeatureExtrusion2(true, false, false, 0, 0, heightOfSpoilerWing, 0.01, false, false, false, false, 1.74532925199433E-02, 1.74532925199433E-02, false, false, false, false, true, true, true, 0, 0, false); //filletForWing Part.ClearSelection2(true); Part.Extension.SelectByID2("", "FACE", xForSelectTopFace - 0.07, yForSelectTopFace + 0.04, 0, false, 0, null, 0); Part.FeatureManager.FeatureFillet3(195, 0.05, 0.01, 0, 0, 0, 0, (0), (0), (0), (0), (0), (0), (0)); Part.Extension.SelectByID2("", "FACE", xForSelectTopFace, yForSelectTopFace + 0.04, (lengthOfSpoiler / 2) / 100, false, 0, null, 0); Part.FeatureManager.FeatureFillet3(195, 0.05, 0.01, 0, 0, 0, 0, (0), (0), (0), (0), (0), (0), (0)); Part.Extension.SelectByID2("", "FACE", (xForSelectTopFace - 0.07) + (widthOfSpoiler) / 100, yForSelectTopFace + 0.04, 0, false, 0, null, 0); Part.FeatureManager.FeatureFillet3(195, 0.05, 0.01, 0, 0, 0, 0, (0), (0), (0), (0), (0), (0), (0)); Part.Extension.SelectByID2("", "FACE", xForSelectTopFace, yForSelectTopFace + 0.04, (-lengthOfSpoiler / 2) / 100, false, 0, null, 0); Part.FeatureManager.FeatureFillet3(195, 0.05, 0.01, 0, 0, 0, 0, (0), (0), (0), (0), (0), (0), (0)); }
public MainWindow() { InitializeComponent(); partService = PartService.GetInstance(); string parametersJson = File.ReadAllText("parameters.json"); assemblyParameters = JsonConvert.DeserializeObject <AssemblyParameters>(parametersJson); initInputs(); //refreshAssemblyImage(); }
private void frontWing(AssemblyParameters parameters) { var Part = swDoc; //double horizontalPosition = 150 / 100.0; //double verticalPosition = 15.0 / 100.0; //double wingLength = 400.0 / 100.0; //double wingThickness = 10.0 / 100.0; double horizontalPosition = parameters.FrontSpolierHorizontalPosition / 100.0; double verticalPosition = parameters.FrontSpoilerVerticalPosition / 100.0; double wingLength = parameters.FrontSpoilerLength / 100.0; double wingThickness = parameters.FrontSpoilerThickness / 100.0; double minCoorx = 800.0 / 100.0; double maxCoorx = 1000.0 / 100.0; double minCoory = -20.0 / 100.0; double maxCoory = 70.0 / 100.0; double minVerticalPosForPlane = 40.0 / 100.0; double maxVerticalPosForPlane = 70.0 / 100.0; double x1ForWing = minCoorx + horizontalPosition; double x2ForWing = x1ForWing - 0.37; double y1ForWing = wingLength / 2.0; double y2ForWing = y1ForWing - 0.15; Part.Extension.SelectByID2("", "FACE", -7.12654479544284, -0.399999999999991, 0.143392113246762, true, 0, null, 0); Part.FeatureManager.InsertRefPlane(264, minVerticalPosForPlane + verticalPosition, 0, 0, 0, 0); Part.Extension.SelectByID2("Plane2", "PLANE", -6.95448737120442, 1.67659184505504, -1.93606080449792, false, 0, null, 0); Part.SketchManager.InsertSketch(true); Part.ClearSelection2(true); Part.SketchManager.CreateLine(x1ForWing, y1ForWing, 0, x2ForWing, y2ForWing, 0); Part.SketchManager.CreateLine(x2ForWing, y2ForWing, 0, x2ForWing, -y2ForWing, 0); Part.SketchManager.CreateLine(x2ForWing, -y2ForWing, 0, x1ForWing, -y1ForWing, 0); Part.SketchManager.CreateLine(x1ForWing, -y1ForWing, 0, x1ForWing, y1ForWing, 0); Part.SetPickMode(); Part.FeatureManager.FeatureExtrusion2(true, false, false, 0, 0, wingThickness, 0.01, false, false, false, false, 1.74532925199433E-02, 1.74532925199433E-02, false, false, false, false, true, true, true, 0, 0, false); Part.SelectionManager.EnableContourSelection = false; double xForSelecting = ((-minCoorx) - horizontalPosition) + 0.05; double y1ForSelecting = verticalPosition; double y2ForSelecting = verticalPosition - wingThickness; double z1ForSelecting = wingLength / 2.0 - 0.15; double z2ForSelecting = (-wingLength / 2.0) + 0.15; Part.ClearSelection2(true); Part.Extension.SelectByID2("", "FACE", xForSelecting, y1ForSelecting, z1ForSelecting, false, 0, null, 0); Part.FeatureManager.FeatureFillet3(195, 0.04, 0.01, 0, 0, 0, 0, (0), (0), (0), (0), (0), (0), (0)); Part.Extension.SelectByID2("", "FACE", xForSelecting, y2ForSelecting, z1ForSelecting, false, 0, null, 0); Part.FeatureManager.FeatureFillet3(195, 0.04, 0.01, 0, 0, 0, 0, (0), (0), (0), (0), (0), (0), (0)); Part.Extension.SelectByID2("", "FACE", xForSelecting, y1ForSelecting, z2ForSelecting, false, 0, null, 0); Part.FeatureManager.FeatureFillet3(195, 0.04, 0.01, 0, 0, 0, 0, (0), (0), (0), (0), (0), (0), (0)); Part.Extension.SelectByID2("", "FACE", xForSelecting, y2ForSelecting, z2ForSelecting, false, 0, null, 0); Part.FeatureManager.FeatureFillet3(195, 0.04, 0.01, 0, 0, 0, 0, (0), (0), (0), (0), (0), (0), (0)); }
private void saveParametersToFile() { if (assemblyParameters == null) { assemblyParameters = new AssemblyParameters(); } assemblyParameters.WheelRadius = double.Parse(wheelRadius.Text); assemblyParameters.WheelWidth = double.Parse(wheelWidth.Text); assemblyParameters.SpoilerLength = double.Parse(spoilerLength.Text); assemblyParameters.SpoilerWidth = double.Parse(spoilerWidth.Text); assemblyParameters.SpoilerThickness = double.Parse(spoilerThickness.Text); assemblyParameters.SpoilerVerticalPosition = double.Parse(spolierVerticalPosition.Text); assemblyParameters.FrontSpoilerLength = double.Parse(frontSpoilerLength.Text); assemblyParameters.FrontSpoilerThickness = double.Parse(frontSpolierThickness.Text); assemblyParameters.FrontSpoilerVerticalPosition = double.Parse(frontSpoilerVerticalPosition.Text); assemblyParameters.FrontSpolierHorizontalPosition = double.Parse(frontSpolierHorizontalPosition.Text); string parametersJson = JsonConvert.SerializeObject(assemblyParameters, Formatting.Indented); File.WriteAllText("parameters.json", parametersJson); }
public void MakeWheel(AssemblyParameters parameters) { createPart(); var Part = swDoc; var skethManager = Part.SketchManager; //double wheelRadius = 80 / 100.0; //double wheelWidth = 80 / 100.0; double wheelRadius = parameters.WheelRadius / 100.0; double wheelWidth = parameters.WheelWidth / 100.0; double wheelInnerCircleRadiusCooficient = 80.0 / 45.0; double wheelOuterInnerCIrcleRadiusCooficient = 80.0 / 55.0; double innerCircleRadius = wheelRadius / wheelInnerCircleRadiusCooficient; double outerInnerCircleRadius = wheelRadius / wheelOuterInnerCIrcleRadiusCooficient; Part.InsertSketch2(true); Part.Extension.SelectByID2("Front Plane", "PLANE", 0, 0, 0, false, 0, null, 0); skethManager.CreateCircleByRadius(0, 0, 0, wheelRadius); Part.FeatureManager.FeatureExtrusion2(true, false, false, 6, 0, wheelWidth, 0.01, false, false, false, false, 1.74532925199433E-02, 1.74532925199433E-02, false, false, false, false, true, true, true, 0, 0, false); Part.ClearSelection2(true); Part.InsertSketch2(true); Part.Extension.SelectByID2("", "FACE", 0, 0, wheelWidth, false, 0, null, 0); Part.CreateCircleByRadius2(0, 0, 0, innerCircleRadius); Part.CreateCircleByRadius2(0, 0, 0, outerInnerCircleRadius); Part.FeatureManager.FeatureCut3(true, false, false, 0, 0, 0.3, 0.01, false, false, false, false, 1.74532925199433E-02, 1.74532925199433E-02, false, false, false, false, false, true, true, true, true, false, 0, 0, false); //Part.ClearSelection2(true); Part.Extension.SelectByID2("", "FACE", wheelRadius - 0.1, 0, wheelWidth / 2.0, false, 0, null, 0); Part.FeatureManager.FeatureFillet3(195, 0.12, 0.012, 0, 0, 0, 0, (0), (0), (0), (0), (0), (0), (0)); Part.Extension.SelectByID2("", "FACE", 0, 0, -wheelWidth / 2.0, false, 0, null, 0); Part.FeatureManager.FeatureFillet3(195, 0.12, 0.012, 0, 0, 0, 0, (0), (0), (0), (0), (0), (0), (0)); Part.ClearSelection2(true); Part.Extension.SelectByID2("", "FACE", 0, 0, wheelWidth / 2.0, false, 0, null, 0); Part.FeatureManager.FeatureFillet3(195, 0.1, 0.01, 0, 0, 0, 0, (0), (0), (0), (0), (0), (0), (0)); bool saved = Part.SaveAs("C:\\Users\\jungl\\Documents\\bilide2\\wheel.sldprt"); if (!saved) { MessageBox.Show("Solidworks не зміг зберегти колесо"); } }
public void MakeBolid(AssemblyParameters parameters) { #region parameters lengthOfMainPart = 800 / 100.0; heightOfMainPart = 80 / 100.0; widthOfMainPart = 150 / 100.0; #endregion createPart(); var Part = swDoc; SketchSegment segment; SketchManager sketchManager = Part.SketchManager; FeatureManager featureManager = Part.FeatureManager; bool boolstatus; boolstatus = Part.Extension.SelectByID2("Front Plane", "PLANE", 0, 0, 0, false, 0, null, 0); Part.SketchManager.InsertSketch(true); segment = sketchManager.CreateLine(0, 0, 0, -lengthOfMainPart, 0, 0); segment = sketchManager.CreateLine(-lengthOfMainPart, 0, 0, -lengthOfMainPart, heightOfMainPart, 0); segment = sketchManager.CreateLine(-lengthOfMainPart, heightOfMainPart, 0, 0, heightOfMainPart, 0); segment = sketchManager.CreateLine(0, heightOfMainPart, 0, 0, 0, 0); Part.Extension.SelectByID2("Line1", "SKETCHSEGMENT", 0, 0, 0, false, 0, null, 0); var extrusion = featureManager.FeatureExtrusion2(true, false, false, 6, 0, widthOfMainPart, 0.01, false, false, false, false, 1.74532925199433E-02, 1.74532925199433E-02, false, false, false, false, true, true, true, 0, 0, false); sketchManager.InsertSketch(true); Part.ClearSelection(); var firstVal = -widthOfMainPart / 2.0; var secondVal = widthOfMainPart / 2.0; sketchManager.InsertSketch(false); Part.Extension.SelectByID2("", "EDGE", 0, 0.04, firstVal, true, 1, null, 1); Part.Extension.SelectByID2("", "EDGE", 0, 0.04, secondVal, true, 1, null, 1); Part.FeatureManager.InsertFeatureChamfer(4, 2, 2.5, 0, 0.6, 0, 0, 0); Part.ClearSelection2(true); Part.Extension.SelectByID2("", "EDGE", -1.60359675146537E-03, 0.468692650695658, -0.161665083159619, false, 1, null, 0); Part.Extension.SelectByID2("", "EDGE", 1.24126468108443E-05, 0.432705387515739, 0.150090293621304, true, 1, null, 0); Part.FeatureManager.FeatureFillet3(195, 0.2, 0.02, 0, 0, 0, 0, (0), (0), (0), (0), (0), (0), (0)); Part.ClearSelection2(true); //sketchManager.InsertSketch(false); Part.Extension.SelectByID2("", "EDGE", -2.50145207253843, 0.409842119252346, 0.759927555199994, true, 1, null, 0); Part.Extension.SelectByID2("", "EDGE", -2.50145207253843, 0.409842119252346, 0.759927555199994, false, 1, null, 0); Part.FeatureManager.FeatureFillet3(195, 3, 3, 0, 0, 0, 0, 0, null, null, null, null, null, null); Part.ClearSelection2(true); //sketchManager.InsertSketch(false); Part.Extension.SelectByID2("", "EDGE", -9.92190741726517E-04, 0.423385979796308, 0.156783427202669, false, 1, null, 0); Part.Extension.SelectByID2("", "EDGE", -3.0946920736028E-03, 0.461205360135011, -0.128842154520996, true, 1, null, 0); Part.FeatureManager.FeatureFillet3(195, 0.2, 3, 0, 0, 0, 0, 0, null, null, null, null, null, null); //Start creating bottom part Part.Extension.SelectByID2("Top Plane", "PLANE", 0, 0, 0, false, 0, null, 0); sketchManager.InsertSketch(true); Part.ClearSelection2(true); double distanceBetweenMainPartAndWheel = 125.0 / 100.0; double widthOFDetailThatLinksMainPartAndWheel = 60.0 / 100.0; Part.SketchManager.CreateLine(-lengthOfMainPart, -widthOfMainPart / 2, 0, -lengthOfMainPart, -widthOfMainPart / 2 - 125 / 100.0, 0); Part.SketchManager.CreateLine(-lengthOfMainPart, -widthOfMainPart / 2 - 125 / 100.0, 0, -lengthOfMainPart + widthOFDetailThatLinksMainPartAndWheel, -widthOfMainPart / 2 - distanceBetweenMainPartAndWheel, 0); Part.SketchManager.CreateLine(-lengthOfMainPart + 60 / 100.0, -widthOfMainPart / 2 - 125.0 / 100.0, 0, -lengthOfMainPart + widthOFDetailThatLinksMainPartAndWheel, (-widthOfMainPart / 2 - 125 / 100.0) + 42.57247318 / 100.0, 0); double x1ForArc1 = -lengthOfMainPart + 122.31294971 / 100.0; double y1ForArc1 = -widthOfMainPart / 2.0; double z1ForArc1 = 0.0; double x2ForArc1 = x1ForArc1 + 106.29290168 / 100.0; double y2ForArc1 = y1ForArc1 - 226.27818952 / 100.0; double z2ForArc1 = 0.0; double x3ForArc1 = -lengthOfMainPart + 60.0 / 100.0; double y3ForArc1 = -widthOfMainPart / 2.0 + (-125.0 + 42.57247318) / 100.0; double z3ForArc1 = 0.0; // Part.SketchManager.Create3PointArc(x1ForArc, y1ForArc, z1ForArc, x2ForArc, y2ForArc, z2ForArc, x3ForArc, y3ForArc, z3ForArc); Part.SketchManager.Create3PointArc(x1ForArc1, y1ForArc1, 0.0, -7.4, -1.574275, 0.0, -7.022504, -1.175317, 0.0); Part.SetPickMode(); Part.ClearSelection2(true); Part.SketchManager.CreateLine(-6.776871, -widthOfMainPart / 2.0, 0, -7.4, -widthOfMainPart / 2.0, 0); Part.SketchManager.CreateLine(-7.4, -widthOfMainPart / 2.0, 0, -7.4, -1.273082, 0); Part.SketchManager.CreateLine(-7.4, -widthOfMainPart / 2.0, 0, -lengthOfMainPart, -widthOfMainPart / 2.0, 0); Part.SketchManager.Create3PointArc(-7.017346, -widthOfMainPart / 2.0, 0, -7.4, -1.273082, 0, -7.17822, -1.06516, 0); Part.SetPickMode(); Part.ClearSelection2(true); //Wing Part.SketchManager.CreateLine(x1ForArc1, y1ForArc1, z1ForArc1, x1ForArc1 + 107.68705029 / 100.0, y1ForArc1, z1ForArc1); Part.SketchManager.CreateLine(x1ForArc1 + 107.68705029 / 100.0, y1ForArc1, z1ForArc1, x1ForArc1 + (107.68705029 + 70.0) / 100.0, y1ForArc1 - 40.0 / 100, z1ForArc1); Part.SketchManager.CreateLine(x1ForArc1 + (107.68705029 + 70.0) / 100.0, y1ForArc1 - 40.0 / 100, z1ForArc1, x1ForArc1 + (107.68705029 + 70.0) / 100.0, y1ForArc1 - 90.0 / 100, z1ForArc1); double x1ForArc3 = Math.Round((x1ForArc1 + (107.68705029 + 70.0 + 240.0) / 100.0), 1); double y1ForArc3 = Math.Round(y1ForArc1 - (90.0 - 23.32770382) / 100.00, 1); double z1FForArc3 = 0.0; //Part.SketchManager.CreateLine(x1ForArc1 + (107.68705029 + 70.0) / 100.0, y1ForArc1 - 90.0 / 100, z1ForArc1, x1ForArc3, y1ForArc3, z1FForArc3); Part.SketchManager.Create3PointArc(x1ForArc3, y1ForArc3, z1FForArc3, -5, -1.65, 0, -3.988716, -1.938586, 0); double x1ForArc4 = x1ForArc3 + 110.0 / 100; double y1ForArc4 = y1ForArc3 + 78.15763134 / 100.0; double z1ForArc4 = 0.0; //Part.SketchManager.CreateLine(x1ForArc3, y1ForArc3, z1FForArc3, x1ForArc4, y1ForArc4, z1ForArc4); Part.SketchManager.Create3PointArc(x1ForArc4, y1ForArc4, z1ForArc4, x1ForArc3, y1ForArc3, z1FForArc3, -2.114926, -0.999068, 0); double x1ForArc5 = x1ForArc4 + 70.0 / 100.0; double y1ForArc5 = y1ForArc4 - 130.82992752 / 100.0; double z1ForArc5 = 0.0; //Part.SketchManager.CreateLine(x1ForArc4, y1ForArc4, z1ForArc4, x1ForArc5, y1ForArc5, z1ForArc5); Part.SketchManager.Create3PointArc(x1ForArc5, y1ForArc5, z1ForArc5, x1ForArc4, y1ForArc4, z1ForArc4, -1.047119, -1.215711, 0); double x2ForArc6 = x1ForArc4 + 13.58 / 100.0; double y2ForArc6 = y1ForArc4 + 7.03 / 100.0; double z2ForArc6 = 0.0; double x1ForArc6 = x1ForArc5; double y1ForArc6 = y1ForArc5 + 43.1674111 / 100.0; double z1ForArc6 = 0.0; //Part.SketchManager.CreateLine(x1ForArc6, y1ForArc6, z1ForArc6, x2ForArc6, y2ForArc6, z2ForArc6); Part.SketchManager.Create3PointArc(x1ForArc6, y1ForArc6, z1ForArc6, x2ForArc6, y2ForArc6, z2ForArc6, -1.004515, -0.966642, 0); double x2ForLine = x1ForArc6; double y2ForLine = y1ForArc6 + 110.0 / 100.0; double z2ForLine = 0.0; Part.SketchManager.CreateLine(x1ForArc6, y1ForArc6, z1ForArc6, x2ForLine, y2ForLine, z2ForLine); Part.SketchManager.Create3PointArc(x2ForArc6, y2ForArc6, z2ForArc6, x2ForLine, y2ForLine, z2ForLine, -1.097502, -0.462248, 0); double x2ForBackWing1 = 0; double y2ForBackWing1 = y1ForArc5; double z2ForBackWing1 = 0; Part.SketchManager.CreateLine(x1ForArc5, y1ForArc5, z1ForArc5, x2ForBackWing1, y2ForBackWing1, z2ForBackWing1); double halfOFLengthOFBackWing = 192.904 / 100.0; double x2ForBackWing2 = 0; double y2ForBackWIng2 = y2ForBackWing1 + halfOFLengthOFBackWing; double z2ForBackWing2 = 0; Part.SketchManager.CreateLine(x2ForBackWing1, y2ForBackWing1, z2ForBackWing1, x2ForBackWing2, y2ForBackWIng2, z2ForBackWing2); double x2ForBackWing3 = 0; double y2ForBackWing3 = y2ForBackWIng2 + halfOFLengthOFBackWing; double z2ForBackWIng3 = 0; Part.SketchManager.CreateLine(x2ForBackWing2, y2ForBackWIng2, z2ForBackWing2, x2ForBackWing3, y2ForBackWing3, z2ForBackWIng3); double x2ForBackWing4 = x1ForArc5; double y2ForBackWing4 = y2ForBackWing3; double z2ForBackWing4 = 0; Part.SketchManager.CreateLine(x2ForBackWing3, y2ForBackWing3, z2ForBackWIng3, x2ForBackWing4, y2ForBackWing4, z2ForBackWing4); //The same but another side of bolide double x2ForCorpseToWheelLine1 = -lengthOfMainPart; double y2ForCorpseToWheelLine1 = widthOfMainPart / 2 + distanceBetweenMainPartAndWheel; double z2ForCorpseToWheelLine1 = 0.0; Part.SketchManager.CreateLine(-lengthOfMainPart, widthOfMainPart / 2, 0, x2ForCorpseToWheelLine1, y2ForCorpseToWheelLine1, z2ForCorpseToWheelLine1); double x2ForCorpseToWheelLine2 = x2ForCorpseToWheelLine1 + widthOFDetailThatLinksMainPartAndWheel; double y2ForCoprseToWheelLine2 = y2ForCorpseToWheelLine1; double z2ForCoprseToWheelLine2 = z2ForCorpseToWheelLine1; Part.SketchManager.CreateLine(x2ForCorpseToWheelLine1, y2ForCorpseToWheelLine1, z2ForCorpseToWheelLine1, x2ForCorpseToWheelLine2, y2ForCoprseToWheelLine2, z2ForCoprseToWheelLine2); double x2ForCorpseToWheelLine3 = x2ForCorpseToWheelLine2; double y2ForCoprseToWheelLine3 = y2ForCorpseToWheelLine1 - 42.57247318 / 100.0; double z2ForCoprseToWheelLine3 = z2ForCoprseToWheelLine2; Part.SketchManager.CreateLine(x2ForCorpseToWheelLine2, y2ForCoprseToWheelLine2, z2ForCoprseToWheelLine2, x2ForCorpseToWheelLine3, y2ForCoprseToWheelLine3, z2ForCoprseToWheelLine3); double x1ForCorpseToWheelArc1 = x1ForArc1; double y1ForCorpseToWheelArc1 = -y1ForArc1; double z1ForCorpseToWheelArc1 = 0; Part.SketchManager.Create3PointArc(x2ForCorpseToWheelLine3, y2ForCoprseToWheelLine3, z2ForCoprseToWheelLine3, x1ForCorpseToWheelArc1, y1ForCorpseToWheelArc1, z1ForCorpseToWheelArc1, -7.02437, 1.177213, 0); double x2ForCorpseToWheelLine4 = -lengthOfMainPart + 60.0 / 100.0; double y2ForCorpseToWheelLine4 = widthOfMainPart / 2.0; double z2ForCorpseToWheelLine4 = 0; Part.SketchManager.CreateLine(x1ForCorpseToWheelArc1, y1ForCorpseToWheelArc1, z1ForCorpseToWheelArc1, x2ForCorpseToWheelLine4, y2ForCorpseToWheelLine4, z2ForCorpseToWheelLine4); double x2ForCoprseToWheelLine5 = x2ForCorpseToWheelLine4; double y2ForCorpseToWheelLine5 = widthOfMainPart / 2 + 52.3082 / 100.0; double z2ForCorpseToWheelLine5 = 0; Part.SketchManager.CreateLine(x2ForCorpseToWheelLine4, y2ForCorpseToWheelLine4, z2ForCorpseToWheelLine4, x2ForCoprseToWheelLine5, y2ForCorpseToWheelLine5, z2ForCorpseToWheelLine5); double x1ForCorpseToWheelArc2 = -lengthOfMainPart + 98.2654 / 100.0; double y1ForCorpseToWheelArc2 = y1ForCorpseToWheelArc1; double z1ForCorpseToWheelArc2 = z1ForCorpseToWheelArc1; Part.SketchManager.CreateLine(x2ForCorpseToWheelLine4, y2ForCorpseToWheelLine4, z2ForCorpseToWheelLine4, -lengthOfMainPart, widthOfMainPart / 2.0, z2ForCoprseToWheelLine2); Part.SketchManager.Create3PointArc(x2ForCoprseToWheelLine5, y2ForCorpseToWheelLine5, z2ForCorpseToWheelLine5, x1ForCorpseToWheelArc2, y1ForCorpseToWheelArc2, z1ForCorpseToWheelArc2, -7.169033, 0.997835, 0); double x2ForCorpseLine1 = x1ForArc1 + 107.68705029 / 100.0; double y2ForCorpseLine1 = widthOfMainPart / 2.0; double z2ForCorpseLine1 = 0; Part.SketchManager.CreateLine(x1ForCorpseToWheelArc2, y1ForCorpseToWheelArc2, z1ForCorpseToWheelArc2, x2ForCorpseLine1, y2ForCorpseLine1, z2ForCorpseLine1); double x2ForCorpseLine2 = x2ForCorpseLine1 + 70.0 / 100.0; double y2ForCorpseLine2 = y2ForCorpseLine1 + 40.0 / 100.0; double z2ForCorpseLine2 = 0.0; Part.SketchManager.CreateLine(x2ForCorpseLine1, y2ForCorpseLine1, z2ForCorpseLine1, x2ForCorpseLine2, y2ForCorpseLine2, z2ForCorpseLine2); double x2ForCorpseLine3 = x2ForCorpseLine2; double y2ForCorpseLine3 = y2ForCorpseLine2 + 50.0 / 100.0; double z2ForCorpseLIne3 = 0.0; Part.SketchManager.CreateLine(x2ForCorpseLine2, y2ForCorpseLine2, z2ForCorpseLine2, x2ForCorpseLine3, y2ForCorpseLine3, z2ForCorpseLIne3); double x2ForCorpseArc1 = x1ForArc3; double y2ForCorpseArc1 = -y1ForArc3; double z2ForCorpseArc1 = z1FForArc3; Part.SketchManager.Create3PointArc(x2ForCorpseLine3, y2ForCorpseLine3, z2ForCorpseLIne3, x2ForCorpseArc1, y2ForCorpseArc1, z2ForCorpseArc1, -3.563352, 1.899428, 0); double x2ForCorpseArc2 = x1ForArc4; double y2ForCorpseArc2 = -y1ForArc4; double z2ForCorpseArc2 = z1ForArc4; Part.SketchManager.Create3PointArc(x2ForCorpseArc1, y2ForCorpseArc1, z2ForCorpseArc1, x2ForCorpseArc2, y2ForCorpseArc2, z2ForCorpseArc2, -2.025267, 0.941125, 0); double x2ForCorpseArc3 = x2ForBackWing4; double y2ForCorpseArc3 = y2ForBackWing4; double z2ForCorpseArc3 = z2ForBackWing4; Part.SketchManager.Create3PointArc(x2ForCorpseArc2, y2ForCorpseArc2, z2ForCorpseArc2, x2ForCorpseArc3, y2ForCorpseArc3, z2ForCorpseArc3, -1.158409, 1.11352, 0); double x2ForCorpseArc4 = x2ForArc6; double y2ForCorpseArc4 = -y2ForArc6; double z2ForCorpseArc4 = z2ForArc6; double x1ForCorpseArc4 = x1ForArc6; double y1ForCorpseArc4 = -y1ForArc6; double z1ForCorpseArc4 = z1ForArc6; Part.SketchManager.Create3PointArc(x1ForCorpseArc4, y1ForCorpseArc4, z1ForCorpseArc4, x2ForCorpseArc4, y2ForCorpseArc4, z2ForCorpseArc4, -1.058286, 0.989618, 0); double x2ForCorpseLine4 = x2ForLine; double y2ForCorpseLine4 = -y2ForLine; double z2ForCorpseLine4 = z2ForLine; Part.SketchManager.CreateLine(x2ForCorpseArc4, y2ForCorpseArc4, z2ForCorpseArc4, x2ForCorpseLine4, y2ForCorpseLine4, z2ForCorpseLine4); Part.SketchManager.CreateLine(x1ForCorpseArc4, y1ForCorpseArc4, z1ForCorpseArc4, x2ForCorpseLine4, y2ForCorpseLine4, z2ForCorpseLine4); //close needed counturs Part.SketchManager.CreateLine(-8, 0.75, 0, -2.5, 0.75, 0); Part.SketchManager.CreateLine(-2.5, 0.75, 0, 0, 0.15, 0); Part.SketchManager.CreateLine(0, 0.15, 0, 0, 0.007679, 0); Part.SketchManager.CreateLine(-0.042941, -0.116145, 0, -0.153325, -0.186798, 0); Part.SketchManager.CreateLine(-0.153325, -0.186798, 0, -2.502459, -0.729218, 0); Part.SketchManager.CreateLine(-2.502459, -0.729218, 0, -2.85496, -0.75, 0); Part.SketchManager.CreateLine(-2.85496, -0.75, 0, -5.7, -0.75, 0); Part.SketchManager.CreateLine(-8, -0.75, 0, -8, 0.75, 0); Thread.Sleep(100); Part.SetPickMode(); Part.SelectionManager.EnableContourSelection = true; Part.Extension.SelectByID2("Sketch2", "SKETCHREGION", -3.9841093791155, 1.92165359018481E-02, -1.11273181579067, true, 4, null, 0); Part.Extension.SelectByID2("Sketch2", "SKETCHREGION", -6.90010975425287, 1.05342333640838, 1.97602960993305, true, 0, null, 0); Part.Extension.SelectByID2("Sketch2", "SKETCHREGION", -6.21591444832203, 2.1019999157831, -0.191076915736342, true, 0, null, 0); Part.Extension.SelectByID2("Sketch2", "SKETCHREGION", -4.3896245678695, -0.268919542014907, 1.3356196563234, true, 0, null, 0); Part.FeatureManager.FeatureExtrusion2(true, false, true, 0, 0, 0.4, 0.4, false, false, false, false, 1.74532925199433E-02, 1.74532925199433E-02, false, false, false, false, true, true, true, 0, 0, false); Part.SelectionManager.EnableContourSelection = false; frontLoft(); driverSit(); backWing(parameters); frontWing(parameters); partEnhancing(); bool saved = swDoc.SaveAs("C:\\Users\\jungl\\Documents\\bilide2\\mainPart.sldprt"); if (!saved) { MessageBox.Show("Solidworks не зміг зберегти корпус боліда. Потрібно перезапустити Solidworks"); } }