private void CreateContourPlates_Click(object sender, EventArgs e) { if (bentPlate != null) { bentPlate.Delete(); bentPlate = null; } CreatePlatesForBox(); CreateBends.Enabled = true; CreateBoxWithCustomRadius.Enabled = true; }
private void SimpleCreateByAddLeg_Click(object sender, EventArgs e) { try { if (bentPlate != null) { bentPlate.Delete(); } var contour1 = new Contour(); contour1.AddContourPoint(new ContourPoint(new Point(0, 0, 0), null)); contour1.AddContourPoint(new ContourPoint(new Point(3000.0, 0, 0), null)); contour1.AddContourPoint(new ContourPoint(new Point(3000.0, 3000.0, 0), null)); contour1.AddContourPoint(new ContourPoint(new Point(0, 3000.0, 0), null)); ConnectiveGeometry geometry = new ConnectiveGeometry(contour1); var contour2 = new Contour(); contour2.AddContourPoint(new ContourPoint(new Point(0, 6000.0, 1500.0), null)); contour2.AddContourPoint(new ContourPoint(new Point(3000.0, 6000.0, 1500.0), null)); contour2.AddContourPoint(new ContourPoint(new Point(3000.0, 6000.0, 4500.0), null)); contour2.AddContourPoint(new ContourPoint(new Point(0, 6000.0, 4500.0), null)); BentPlateGeometrySolver solver = new BentPlateGeometrySolver(); geometry = solver.AddLeg(geometry, contour2); bentPlate = new BentPlate { Name = "Plate", Material = { MaterialString = "S235JR" }, Profile = { ProfileString = "PL20" } }; bentPlate.Geometry = geometry; bentPlate.Insert(); model.CommitChanges(); } catch (Exception Ex) { Console.WriteLine("Exception : ", Ex.ToString()); } }