Пример #1
0
        public BoltArray insert_hole(PolyBeam mainPart, t3d.Point point1, t3d.Point point2, double size, double angle)
        {
            BoltArray hole = new BoltArray();

            hole.PartToBeBolted          = mainPart;
            hole.PartToBoltTo            = mainPart;
            hole.FirstPosition           = point1;
            hole.SecondPosition          = point2;
            hole.Position.Rotation       = Position.RotationEnum.BACK;
            hole.Position.RotationOffset = angle;
            hole.Position.Rotation       = Position.RotationEnum.BACK;
            hole.Position.Depth          = Position.DepthEnum.MIDDLE;
            hole.Position.Plane          = Position.PlaneEnum.MIDDLE;
            hole.AddBoltDistX(0);
            hole.AddBoltDistY(0);
            hole.Tolerance = 0;
            hole.BoltSize  = size;

            hole.Hole1   = false;
            hole.Hole2   = false;
            hole.Hole3   = false;
            hole.Hole4   = false;
            hole.Hole5   = false;
            hole.Washer1 = false;
            hole.Washer2 = false;
            hole.Washer3 = false;
            hole.Nut1    = false;
            hole.Nut2    = false;

            hole.Insert();
            return(hole);
        }
Пример #2
0
        private void GetInfoFromDrawing(DrawingObject pickedObject)
        {
            modelObjectTextBox.Clear();

            if (pickedObject != null)
            {
                TSD.ModelObject modelObjectInDrawing = pickedObject as TSD.ModelObject;
                if (modelObjectInDrawing != null)
                {
                    TSM.ModelObject modelObjectInModel = model.SelectModelObject(modelObjectInDrawing.ModelIdentifier);
                    if (modelObjectInModel is TSM.Part)
                    {
                        Beam beam = modelObjectInModel as Beam;
                        if (beam != null)
                        {
                            GetBeamInfo(beam);
                        }
                        PolyBeam polyBeam = modelObjectInModel as PolyBeam;
                        if (polyBeam != null)
                        {
                            GetPolyBeamInfo(polyBeam);
                        }
                        ContourPlate contourPlate = modelObjectInModel as ContourPlate;
                        if (contourPlate != null)
                        {
                            GetContourPlateInfo(contourPlate);
                        }
                    }
                }
            }
        }
Пример #3
0
        public void get_circle_center(PolyBeam main_part, out t3d.Point center, out double radius)
        {
            model.GetWorkPlaneHandler().SetCurrentTransformationPlane(new TransformationPlane());
            CoordinateSystem mainPart_coordinat = main_part.GetCoordinateSystem();

            if (main_part.Position.Rotation == Position.RotationEnum.BACK || main_part.Position.Rotation == Position.RotationEnum.FRONT)
            {
                mainPart_coordinat.AxisY = mainPart_coordinat.AxisX.Cross(mainPart_coordinat.AxisY);
            }

            model.GetWorkPlaneHandler().SetCurrentTransformationPlane(new TransformationPlane(mainPart_coordinat));
            ArrayList points = main_part.GetCenterLine(true);

            //  getCircleCenter(points[0] as t3d.Point, points[points.Count-1] as t3d.Point, points[(int)(points.Count/2)] as t3d.Point,out a,out b,out c);
            t3d.Point point_1 = points[(int)(points.Count / 2) - 1] as t3d.Point;
            t3d.Point point_2 = points[(int)(points.Count / 2)] as t3d.Point;
            t3d.Point point_3 = points[((int)(points.Count / 2) + 1)] as t3d.Point;
            Line      _1_line = new Line(point_1, point_2);
            Line      _2_line = new Line(point_3, point_2);

            t3d.Point  mid_of_1line = new t3d.Point((point_1.X + point_2.X) / 2, (point_1.Y + point_2.Y) / 2, (point_1.Z + point_2.Z) / 2);
            t3d.Point  mid_of_2line = new t3d.Point((point_3.X + point_2.X) / 2, (point_3.Y + point_2.Y) / 2, (point_3.Z + point_2.Z) / 2);
            t3d.Vector fist_vector  = new Vector(_1_line.Direction);
            t3d.Vector scnd_vector  = new Vector(_2_line.Direction);

            t3d.Line    first_intersected_line = new Line(mid_of_1line, fist_vector.Cross(new t3d.Vector(0, 0, 1)));
            t3d.Line    sec_intersected_line   = new Line(mid_of_2line, scnd_vector.Cross(new t3d.Vector(0, 0, 1)));
            LineSegment final = Intersection.LineToLine(first_intersected_line, sec_intersected_line);

            // radius
            radius = Math.Sqrt(Math.Pow(point_1.X - final.Point1.X, 2) + Math.Pow(point_1.Y - final.Point1.Y, 2));
            center = final.Point1;
        }
Пример #4
0
        // method for modeling beam
        public void ModelBeam(ArrayList userPoints, string beamProfile)
        {
            // if user has only picked one point
            // display error message
            if (userPoints.Count == 1)
            {
                MessageBox.Show("Not enough points");
            }
            // if user has only picked two points
            // create standard beam
            else if (userPoints.Count == 2)
            {
                // create new beam modeler
                StandardBeamModeler myBeamModeler = new StandardBeamModeler(classModel);

                // model beam
                myBeamModeler.ModelBeam(userPoints, beamProfile);
            }
            // if user selects 3 or more points
            else if (userPoints.Count >= 3)
            {
                // create new beam
                PolyBeam modelerBeam = new PolyBeam();
                base.classBeam = modelerBeam;

                // assign first value in array list as start point
                base.classBeam.AddContourPoint(new ContourPoint(userPoints[0] as T3D.Point, null));

                // loop through values in array list, stopping before the last value
                // add chamfer to each internal point
                for (int i = 1; i < userPoints.Count - 1; i++)
                {
                    base.classBeam.AddContourPoint(new ContourPoint(userPoints[i] as T3D.Point, new Chamfer(0, 0, Chamfer.ChamferTypeEnum.CHAMFER_ARC_POINT)));
                }

                // assign last value in array list as end point
                base.classBeam.AddContourPoint(new ContourPoint(userPoints[userPoints.Count - 1] as T3D.Point, null));

                // set parameters for beam
                base.setProfile(beamProfile);
                base.setName("THIS_BEAM");
                base.setFinish("Galvanized");
                base.setClass("9");
                base.setAssemblyNumPrefix("MXH");
                base.setAssemblyStartNum(1);
                base.setPartNumPrefix("HR");
                base.setPartStartNum(1);
                base.setMaterialString("A992");

                // set position for beam
                base.classBeam.Position.Depth    = Position.DepthEnum.BEHIND; // set depth to behind
                base.classBeam.Position.Plane    = Position.PlaneEnum.MIDDLE; // set plane position to middle
                base.classBeam.Position.Rotation = Position.RotationEnum.TOP; // set rotation to top

                base.insertBeam();                                            // insert beam into model

                base.updateModel();                                           // commit changes to model
            }
        }
 public static dynamic GetTSObject(PolyBeam dynObject)
 {
     if (dynObject is null)
     {
         return(null);
     }
     return(dynObject.teklaObject);
 }
        private Part CreateBeamOrPoly(JsPart beamSpec)
        {
            Part beam = null;

            if (null == beamSpec || null == beamSpec.points || beamSpec.points.Length < 2)
            {
                return(null);
            }
            Position.PlaneEnum plane = Position.PlaneEnum.MIDDLE; //< woods
            if (beamSpec.points.Length == 2)
            {
                beam = new Beam
                {
                    StartPoint = beamSpec.points[0].ToTS(),
                    EndPoint   = beamSpec.points[1].ToTS(),
                    Position   = new Position()
                    {
                        Depth = Position.DepthEnum.MIDDLE,
                        Plane = Position.PlaneEnum.MIDDLE
                    }
                };
                if (null != beamSpec.rotation)
                {
                    beam.Position.Rotation = EnumConverter.TryFromInt((int)beamSpec.rotation, Position.RotationEnum.FRONT);
                }
            }
            else
            {
                beam = new PolyBeam
                {
                    Contour = new Contour()
                    {
                        ContourPoints = new ArrayList(beamSpec.points.Select(p => new ContourPoint(p.ToTS(), null)).ToList())
                    },
                    Position = new Position()
                    {
                        Depth = Position.DepthEnum.FRONT,
                        Plane = Position.PlaneEnum.LEFT
                    },
                };
            }

            beam.Material = ChainSaw.FromString(beamSpec.material);
            beam.Profile  = new Profile
            {
                ProfileString = beamSpec.profile
            };
            if (null != beamSpec?.klass)
            {
                beam.Class = beamSpec.klass.ToString();
            }
            //beam.Position = new Position
            //{
            //    Depth = Position.DepthEnum.,
            //    Plane = plane
            //};
            return(beam);
        }
        public void CK07_Polybeam()
        {
            ArrayList PickedPoints = null;
            Picker    Picker       = new Picker();

            try
            {
                PickedPoints = Picker.PickPoints(Picker.PickPointEnum.PICK_POLYGON);
            }
            catch { PickedPoints = null; }
            if (PickedPoints != null)
            {
                PolyBeam ThisPolyBeam = new PolyBeam();
                ThisPolyBeam.Profile.ProfileString = mw.prfStr;
                ThisPolyBeam.Name   = "CURVED PLATE";
                ThisPolyBeam.Finish = "GALVANIZED";
                ThisPolyBeam.Class  = "6";
                ThisPolyBeam.AssemblyNumber.Prefix      = "P";
                ThisPolyBeam.AssemblyNumber.StartNumber = 1;
                ThisPolyBeam.PartNumber.Prefix          = "m";
                ThisPolyBeam.Material.MaterialString    = "C245";
                ThisPolyBeam.Position.Depth             = Position.DepthEnum.FRONT;
                ThisPolyBeam.Position.Plane             = Position.PlaneEnum.MIDDLE;
                ThisPolyBeam.Position.Rotation          = Position.RotationEnum.TOP;
                if (PickedPoints.Count == 3)
                {
                    ThisPolyBeam.AddContourPoint(new ContourPoint(PickedPoints[0] as T3D.Point, null));
                    ThisPolyBeam.AddContourPoint(new ContourPoint(PickedPoints[1] as T3D.Point, new Chamfer(0, 0, Chamfer.ChamferTypeEnum.CHAMFER_ARC_POINT)));
                    ThisPolyBeam.AddContourPoint(new ContourPoint(PickedPoints[2] as T3D.Point, null));
                    mw.Msg("Выбрано 3 точки; по ним строится дуговая балка.   [OK]");
                }
                else
                {
                    foreach (T3D.Point ThisPoint in PickedPoints)
                    {
                        ThisPolyBeam.AddContourPoint(new ContourPoint(ThisPoint, null));
                    }
                    mw.Msg($"Выбрано {PickedPoints.Count} точек. Фаски составной балки отсутствуют.  [OK]");
                }
                ThisPolyBeam.Insert();
            }
            Model.GetWorkPlaneHandler()
            .SetCurrentTransformationPlane(new TransformationPlane());
            ViewHandler.SetRepresentation("standard"); //PKh> should be add for Tekla-2018
            Model.CommitChanges();

//            mw.Msg("  [OK]");
            MessageBox.Show("Построена составная балка.");
            mw.Msg();
        }
Пример #8
0
 private void GetPolyBeamInfo(PolyBeam polyBeam)
 {
     modelObjectTextBox.Text = TSM.ModelObject.ModelObjectEnum.POLYBEAM.ToString() + Environment.NewLine +
                               "Name: " + polyBeam.Name + Environment.NewLine +
                               "Id: " + polyBeam.Identifier.ID.ToString() + Environment.NewLine +
                               "Material: " + polyBeam.Material.MaterialString + Environment.NewLine +
                               "Profile: " + polyBeam.Profile.ProfileString + Environment.NewLine +
                               "Contour point: " + polyBeam.Contour.ContourPoints.ToString() + Environment.NewLine +
                               "Class: " + polyBeam.Class + Environment.NewLine +
                               "Finish: " + polyBeam.Finish + Environment.NewLine +
                               "Position depth: " + polyBeam.Position.Depth.ToString() + Environment.NewLine +
                               "Position plane: " + polyBeam.Position.Plane.ToString() + Environment.NewLine +
                               "Position rotation: " + polyBeam.Position.Rotation.ToString() + Environment.NewLine +
                               "Father assembly: " + polyBeam.GetAssembly().Name.ToString();
 }
Пример #9
0
        private static ModelObject CreateBlacha(Contour testowy, bool strona)
        {
            PolyBeam blacha = new PolyBeam();


            blacha.Contour = testowy;
            blacha.Name    = "BLACHA";
            blacha.Profile.ProfileString   = "BL15*60";
            blacha.Material.MaterialString = "S355JR";
            blacha.Class = "2";
            if (strona == true)
            {
                blacha.Position.Plane = Position.PlaneEnum.RIGHT;
            }
            else
            {
                blacha.Position.Plane = Position.PlaneEnum.LEFT;
            }
            blacha.Position.Depth = Position.DepthEnum.MIDDLE;

            return(blacha);
        }
        private void button1_Click(object sender, EventArgs e)
        {
            #region connection to Tekla Structures and basic model path, version information

            Model  Model1        = new Model();
            string modelname     = Model1.GetInfo().ModelName;
            string modelpath     = Model1.GetInfo().ModelPath;
            string configuration = ModuleManager.Configuration.ToString();
            string TSversion     = TeklaStructuresInfo.GetCurrentProgramVersion();

            string tB = textBox1.Text;
            char   ch = '*';

            List <Beam>         ListBeamPlate = new List <Beam>();         // List Beam
            List <ContourPlate> ListPlate     = new List <ContourPlate>(); //List Plate
            List <PolyBeam>     ListPolyBeam  = new List <PolyBeam>();     //List Poly Beam

            ArrayList AllParts = new ArrayList();

            #endregion

            string CNC_Files = textBox2.Text;

            if (!Directory.Exists(modelpath + @"\" + CNC_Files))
            {
                Directory.CreateDirectory(modelpath + @"\" + CNC_Files);
            }

            //Выбор деталей
            Picker Picker = new Picker();

            try
            {   //Перечесляем выбранные детали
                ModelObjectEnumerator input = Picker.PickObjects(Picker.PickObjectsEnum.PICK_N_PARTS, "Выберите детали");

                IEnumerator enumerator = input.GetEnumerator();

                //добовляем в масив
                while (enumerator.MoveNext())
                {
                    Beam         beam         = enumerator.Current as Beam;
                    ContourPlate contourPlate = enumerator.Current as ContourPlate;
                    PolyBeam     polyBeam     = enumerator.Current as PolyBeam;

                    if (beam != null)
                    {
                        ListBeamPlate.Add(beam);
                    }
                    if (contourPlate != null)
                    {
                        ListPlate.Add(contourPlate);
                    }
                    if (polyBeam != null)
                    {
                        ListPolyBeam.Add(polyBeam);
                    }
                }

                #region
                //    ArrayList ObjectsToSelect = new ArrayList();

                //    Part part = enumerator.Current as Part;
                //    ObjectsToSelect.Add(part);

                // string partProfileF = part.Profile.ProfileString;
                //    char ch = '*';
                //int partProfileF2 = partProfileF.IndexOf(ch);

                //ArrayList pathPartA = new ArrayList();

                //try { string partProfileF3 = partProfileF.Remove(partProfileF.IndexOf('*'), partProfileF.Length - partProfileF.IndexOf('*')); pathPartA.Add(partProfileF3); }
                //catch { string partProfileF3 = partProfileF; pathPartA.Add(partProfileF3); }

                //    string partProfileF1 = pathPartA[0].ToString();

                //    int indexOf = partProfileF.IndexOf("PL");
                //    string partMaterial = part.Material.MaterialString;
                //    Tekla.Structures.Model.UI.ModelObjectSelector MS = new Tekla.Structures.Model.UI.ModelObjectSelector();
                //    MS.Select(ObjectsToSelect);


                //    if (indexOf == 0)
                //    {

                //        if (!Directory.Exists(modelpath + @"\" + CNC_Files + @"\" + partProfileF1 + "_" + partMaterial))
                //        {
                //            Directory.CreateDirectory(modelpath + @"\" + CNC_Files + @"\" + partProfileF1 + "_" + partMaterial);
                //        }


                //        string pathPart = modelpath + @"\" + CNC_Files + @"\" + partProfileF1 + "_" + partMaterial + @"\";


                //        Operation.CreateNCFilesFromSelected("DSTV for plates", pathPart);

                //        Operation.DisplayPrompt("ok");
                //    }

                // }
                #endregion
            }
            catch { Operation.DisplayPrompt("что то пошло не так..."); }
            // находим в пластины замоделенной балке
            int countPlateBeamT = 0;

            List <MyPlate> PlateBeamT = new List <MyPlate>();

            foreach (Beam beam in ListBeamPlate)
            {
                string PB = beam.Profile.ProfileString;

                if (PB.StartsWith(tB))
                {
                    string  PP1     = PB.Substring(0, PB.LastIndexOf(ch));
                    string  PP2     = beam.Material.MaterialString;
                    MyPlate myPlate = new MyPlate
                    {
                        PlateProfile  = PP1,
                        PlateMaterial = PP2
                    };
                    PlateBeamT.Add(myPlate);
                    countPlateBeamT++;
                }
            }

            foreach (PolyBeam beam in ListPolyBeam)
            {
                string PB = beam.Profile.ProfileString;

                if (PB.StartsWith(tB))
                {
                    string  PP1     = PB.Substring(0, PB.LastIndexOf(ch));
                    string  PP2     = beam.Material.MaterialString;
                    MyPlate myPlate = new MyPlate
                    {
                        PlateProfile  = PP1,
                        PlateMaterial = PP2
                    };
                    PlateBeamT.Add(myPlate);

                    countPlateBeamT++;
                }
            }

            int countPlatePlate = 0;

            foreach (ContourPlate contourPlate in ListPlate)
            {
                string PP1 = contourPlate.Profile.ProfileString;
                string PP2 = contourPlate.Material.MaterialString;

                MyPlate myPlate = new MyPlate
                {
                    PlateProfile  = PP1,
                    PlateMaterial = PP2
                };

                PlateBeamT.Add(myPlate);
                countPlatePlate++;
            }


            //Объединение list<>
            List <MyPlate> filterMP        = new List <MyPlate>();
            List <MyPlate> filterMP2       = new List <MyPlate>();
            List <MyPlate> filterMP2Sorted = new List <MyPlate>(); // итоговый список

            var dist = PlateBeamT.Distinct(new MyPlateComparer());

            foreach (MyPlate s in dist)
            {
                try
                {
                    string  PP      = s.PlateProfile.Substring(0, s.PlateProfile.LastIndexOf("."));
                    string  PM      = s.PlateMaterial;
                    MyPlate myPlate = new MyPlate
                    {
                        PlateProfile  = PP,
                        PlateMaterial = PM,
                    };
                    filterMP.Add(myPlate);
                }
                catch
                {
                    string  PP      = s.PlateProfile;
                    string  PM      = s.PlateMaterial;
                    MyPlate myPlate = new MyPlate
                    {
                        PlateProfile  = PP,
                        PlateMaterial = PM,
                    };
                    filterMP.Add(myPlate);
                }
            }


            var dist2 = filterMP.Distinct(new MyPlateComparer());

            foreach (MyPlate d in dist2)
            {
                filterMP2.Add(d);
            }

            var SortedfMP2 = from u in filterMP2
                             orderby u.PlateMaterial, u.PlateProfile
            select u;

            foreach (MyPlate u in SortedfMP2)
            {
                filterMP2Sorted.Add(u);
            }
            //выбор деталей по толщине и марке стали
            for (int i = 0; i < filterMP2Sorted.Count; i++)
            {
                try
                {
                    ArrayList y1 = new ArrayList();

                    var x1 = from plate in ListPlate
                             where plate.Profile.ProfileString == filterMP2Sorted[i].PlateProfile
                             where plate.Material.MaterialString == filterMP2Sorted[i].PlateMaterial
                             select plate;

                    var x2 = from plateB in ListBeamPlate
                             where plateB.Profile.ProfileString.StartsWith(filterMP2Sorted[i].PlateProfile)
                             where plateB.Material.MaterialString == filterMP2Sorted[i].PlateMaterial
                             select plateB;

                    var x3 = from plateB in ListPolyBeam
                             where plateB.Profile.ProfileString.StartsWith(filterMP2Sorted[i].PlateProfile)
                             where plateB.Material.MaterialString == filterMP2Sorted[i].PlateMaterial
                             select plateB;

                    foreach (ContourPlate plate in x1)
                    {
                        y1.Add(plate);
                    }

                    foreach (Beam beam in x2)
                    {
                        y1.Add(beam);
                    }

                    foreach (PolyBeam polyBeam in x3)
                    {
                        y1.Add(polyBeam);
                    }


                    Tekla.Structures.Model.UI.ModelObjectSelector MS = new Tekla.Structures.Model.UI.ModelObjectSelector();
                    MS.Select(y1);

                    if (!Directory.Exists(modelpath + @"\" + CNC_Files + @"\" + filterMP2Sorted[i].PlateProfile + "_" + filterMP2Sorted[i].PlateMaterial))
                    {
                        Directory.CreateDirectory(modelpath + @"\" + CNC_Files + @"\" + filterMP2Sorted[i].PlateProfile + "_" + filterMP2Sorted[i].PlateMaterial);
                    }

                    string pathPart = modelpath + @"\" + CNC_Files + @"\" + filterMP2Sorted[i].PlateProfile + "_" + filterMP2Sorted[i].PlateMaterial + @"\";

                    Operation.CreateNCFilesFromSelected("DSTV for plates", pathPart);
                }

                catch { Operation.DisplayPrompt("что то пошло не так...."); }
            }

            Tekla.Structures.Model.UI.ModelObjectSelector MS1 = new Tekla.Structures.Model.UI.ModelObjectSelector();
            MS1.Select(AllParts);
            Operation.DisplayPrompt("Готово... //work by Wiz//");
        }
Пример #11
0
 public void createconnection(Point center_point, ArrayList Gratting_assembly_arraylist)
 {
     foreach (Identifier ID in Gratting_assembly_arraylist)
     {
         Part part1 = (Part)this.myModel.SelectModelObject(ID);
         this.myModel.GetWorkPlaneHandler().SetCurrentTransformationPlane(new TransformationPlane());
         this.myModel.GetWorkPlaneHandler().SetCurrentTransformationPlane(new TransformationPlane());
         this.Get_Lower_face_edge(part1);
         string Partprofile1;
         string Partprofile2;
         if (this.data.holeType == 0)
         {
             Partprofile1 = "ROD" + (this.data.holeDiam - this.data.Plate_h).ToString();
             Partprofile2 = "ROD" + this.data.holeDiam.ToString();
         }
         else
         {
             Partprofile1 = this.data.hole_L.ToString() + "*" + this.data.hole_w.ToString();
             Partprofile2 = Partprofile1;
         }
         Assembly assembly = part1.GetAssembly();
         assembly.SetMainPart(part1);
         ArrayList secondaries = assembly.GetSecondaries();
         for (int index = 0; index < secondaries.Count; ++index)
         {
             if (secondaries[index].GetType().Name == "PolyBeam")
             {
                 secondaries.RemoveAt(secondaries.IndexOf(secondaries[index]));
                 if (index > 0)
                 {
                     --index;
                 }
                 else
                 {
                     index = 0;
                 }
                 if (secondaries.Count == 0)
                 {
                     break;
                 }
             }
             if (((Part)secondaries[index]).Class != "211")
             {
                 this.CreateCut(center_point, (Part)secondaries[index], Partprofile2).Delete();
             }
         }
         Beam cut1 = this.CreateCut(center_point, part1, Partprofile1);
         OBB  obb1 = this.CreateObb((Part)cut1);
         List <LineSegment> lowerFaceEdge   = this.Get_Lower_face_edge(part1);
         List <Beam>        beamList        = new List <Beam>();
         List <LineSegment> lineSegmentList = new List <LineSegment>();
         if (this.data.holeType == 0)
         {
             Point point1 = new Point();
             Point point2 = new Point();
             foreach (LineSegment lineSegment in lowerFaceEdge)
             {
                 if (obb1.Intersects(lineSegment))
                 {
                     LineSegment obb2 = Intersection.LineSegmentToObb(lineSegment, obb1);
                     lineSegmentList.Add(obb2);
                 }
             }
             Point point1_1 = lineSegmentList[lineSegmentList.Count / 2].Point1;
             List <LineSegment>           lowerEdge = this.new_get_lower_edge(part1);
             ArrayList                    arrayList = new ArrayList();
             List <Point>                 pointList = new List <Point>();
             Tekla.Structures.Model.Solid solid     = cut1.GetSolid();
             foreach (LineSegment line in lowerEdge)
             {
                 if ((uint)solid.Intersect(line).Count > 0U)
                 {
                     foreach (object obj in solid.Intersect(line))
                     {
                         pointList.Add(obj as Point);
                     }
                 }
             }
             Point P1 = pointList[0];
             Point P2 = pointList[pointList.Count - 1];
             if (point1_1 == P1 || point1_1 == P2)
             {
                 point1_1 = lineSegmentList[lineSegmentList.Count / 2 - 1].Point1;
             }
             Chamfer C = new Chamfer();
             C.Type = Chamfer.ChamferTypeEnum.CHAMFER_ARC_POINT;
             PolyBeam polyBeam = new PolyBeam();
             polyBeam.Profile.ProfileString   = "PL" + this.data.Plate_b.ToString() + "*" + this.data.Plate_h.ToString();
             polyBeam.Position.Depth          = Position.DepthEnum.FRONT;
             polyBeam.Position.Plane          = Position.PlaneEnum.MIDDLE;
             polyBeam.Position.Rotation       = Position.RotationEnum.TOP;
             polyBeam.Position.DepthOffset    = this.data.offset;
             polyBeam.Material.MaterialString = this.data.Plate_matrial;
             polyBeam.PartNumber.Prefix       = this.data.Pos_1;
             polyBeam.PartNumber.StartNumber  = this.data.Plate_pos2;
             polyBeam.Name = this.data.Plate_name;
             polyBeam.AddContourPoint(new ContourPoint(P1, (Chamfer)null));
             polyBeam.AddContourPoint(new ContourPoint(point1_1, C));
             polyBeam.AddContourPoint(new ContourPoint(P2, (Chamfer)null));
             polyBeam.Insert();
             Beam cut2 = this.CreateCut(center_point, part1, Partprofile2);
             this.insert_weld(part1, (Part)polyBeam);
             cut1.Delete();
             cut2.Delete();
             ModelObjectEnumerator booleans = polyBeam.GetBooleans();
             while (booleans.MoveNext())
             {
                 (booleans.Current as BooleanPart).Delete();
             }
         }
         else
         {
             foreach (LineSegment lineSegment in lowerFaceEdge)
             {
                 if (obb1.Intersects(lineSegment))
                 {
                     try
                     {
                         LineSegment obb2 = Intersection.LineSegmentToObb(lineSegment, obb1);
                         Beam        beam = this.insert_toeplate(obb2.Point1, obb2.Point2);
                         this.insert_weld(part1, (Part)beam);
                         beamList.Add(beam);
                     }
                     catch (Exception)
                     {
                     }
                 }
             }
             cut1.Delete();
             foreach (Part part2 in beamList)
             {
                 ModelObjectEnumerator booleans = part2.GetBooleans();
                 while (booleans.MoveNext())
                 {
                     (booleans.Current as BooleanPart).Delete();
                 }
             }
             for (int index = 0; index < beamList.Count; ++index)
             {
                 try
                 {
                     this.part_cut((Part)beamList[index], (Part)beamList[index + 1]);
                 }
                 catch (Exception)
                 {
                 }
             }
             try
             {
                 this.part_cut((Part)beamList[beamList.Count - 1], (Part)beamList[0]);
             }
             catch (Exception)
             {
             }
             for (int index = 0; index < secondaries.Count; ++index)
             {
                 Beam beam = secondaries[index] as Beam;
                 if (beam.Class == "211")
                 {
                     secondaries.Remove((object)beam);
                     index = -1;
                 }
             }
             foreach (Part GPart in secondaries)
             {
                 foreach (LineSegment lineSegment in this.Get_Lower_face_edge(GPart))
                 {
                     if (obb1.Intersects(lineSegment))
                     {
                         try
                         {
                             LineSegment obb2 = Intersection.LineSegmentToObb(lineSegment, obb1);
                             Beam        beam = this.insert_toeplate(obb2.Point1, obb2.Point2);
                             beamList.Add(beam);
                         }
                         catch (Exception)
                         {
                         }
                     }
                 }
             }
             for (int index1 = 0; index1 <= beamList.Count - 1; ++index1)
             {
                 Beam beam1 = beamList[index1];
                 for (int index2 = index1 + 1; index2 <= beamList.Count - 1; ++index2)
                 {
                     Beam beam2 = beamList[index2];
                     this.combine_beams_have_same_vector((Part)beam1, (Part)beam2);
                 }
             }
         }
     }
 }