Example #1
0
        ContourPlate CreateConturePlate(TSG.Point point)
        {
            double x = 300;
            double y = 300;

            TSG.Point point1 = new TSG.Point(point.X - x / 2, point.Y - y / 2, point.Z);
            TSG.Point point2 = new TSG.Point(point.X + x / 2, point.Y - y / 2, point.Z);
            TSG.Point point3 = new TSG.Point(point.X + x / 2, point.Y + y / 2, point.Z);
            TSG.Point point4 = new TSG.Point(point.X - x / 2, point.Y + y / 2, point.Z);

            ContourPlate CP            = new ContourPlate();
            ContourPoint conturePoint1 = new ContourPoint(point1, null);
            ContourPoint conturePoint2 = new ContourPoint(point2, null);
            ContourPoint conturePoint3 = new ContourPoint(point3, null);
            ContourPoint conturePoint4 = new ContourPoint(point4, null);

            CP.AddContourPoint(conturePoint1);
            CP.AddContourPoint(conturePoint2);
            CP.AddContourPoint(conturePoint3);
            CP.AddContourPoint(conturePoint4);
            CP.Finish = "FOO";
            CP.Profile.ProfileString   = "PL10";
            CP.Material.MaterialString = "S235";

            return(CP);
        }
        private Part DrawUpFloor(Point input, Vector alongStairVect, double width, double length, double overlap, string floorProfile, string floorMaterial)
        {
            Vector zaxis     = new Vector(0, 0, -1);
            Vector shortEdge = Vector.Cross(zaxis, alongStairVect);

            alongStairVect = alongStairVect * length * (-1);
            Vector shortEdgeLeft     = shortEdge * ((width + 2 * overlap) / 2);
            Vector shortEdgeRight    = shortEdgeLeft * (-1);
            Point  leftNearCornerPt  = new Point(input.X + shortEdgeLeft.X, input.Y + shortEdgeLeft.Y, input.Z + shortEdgeLeft.Z);
            Point  rightNearCornerPt = new Point(input.X + shortEdgeRight.X, input.Y + shortEdgeRight.Y, input.Z + shortEdgeRight.Z);
            Point  leftFarCornerPt   = new Point(leftNearCornerPt.X + alongStairVect.X, leftNearCornerPt.Y + alongStairVect.Y, leftNearCornerPt.Z + alongStairVect.Z);
            Point  rightFarCornerPt  = new Point(rightNearCornerPt.X + alongStairVect.X, rightNearCornerPt.Y + alongStairVect.Y, rightNearCornerPt.Z + alongStairVect.Z);

            ContourPoint leftCpStartPt  = new ContourPoint(leftNearCornerPt, null);
            ContourPoint leftCpEndPt    = new ContourPoint(leftFarCornerPt, null);
            ContourPoint rightCpStartPt = new ContourPoint(rightNearCornerPt, null);
            ContourPoint rightCpEndPt   = new ContourPoint(rightFarCornerPt, null);

            ContourPlate floorBeam = new ContourPlate();

            floorBeam.AddContourPoint(leftCpStartPt);
            floorBeam.AddContourPoint(leftCpEndPt);
            floorBeam.AddContourPoint(rightCpEndPt);
            floorBeam.AddContourPoint(rightCpStartPt);
            floorBeam.Profile.ProfileString   = floorProfile;
            floorBeam.Material.MaterialString = floorMaterial;
            floorBeam.Position.Depth          = Position.DepthEnum.FRONT;

            floorBeam.Insert();

            return(floorBeam);
        }
Example #3
0
 public static dynamic GetTSObject(ContourPoint dynObject)
 {
     if (dynObject is null)
     {
         return(null);
     }
     return(dynObject.teklaObject);
 }
Example #4
0
        private void MallinnaLaatta()
        {
            ModelObjectSelector   mSelector = malli.GetModelObjectSelector();
            ModelObjectEnumerator enumer    = mSelector.GetAllObjects();

            for (int i = 0; i < enumer.GetSize(); i++)
            {
                ModelObject obj = enumer.Current;
                if (obj is ContourPlate)
                {
                    if (((ContourPlate)obj).Name == "LASKETTU_LAATTA")
                    {
                        ContourPlate laattaTemp = (ContourPlate)obj;
                        laattaTemp.Contour.ContourPoints[0] = new ContourPoint(new Point(0, 0, 3000), null);
                        laattaTemp.Contour.ContourPoints[1] = new ContourPoint(new Point(0, laatanKorkeus, 3000), null);
                        laattaTemp.Contour.ContourPoints[2] = new ContourPoint(new Point(laatanLeveys, laatanKorkeus, 3000), null);
                        laattaTemp.Contour.ContourPoints[3] = new ContourPoint(new Point(laatanLeveys, 0, 3000), null);
                        PoistaRaudoitus(laattaTemp);
                        laattaTemp.Modify();
                        malli.CommitChanges();
                        return;
                    }
                }
                enumer.MoveNext();
            }
            ContourPlate laatta = new ContourPlate();

            laatta.Name = "LASKETTU_LAATTA";
            ContourPoint vasenAlanurkka = new ContourPoint(new Point(0, 0, 3000), null);
            ContourPoint vasenYlanurkka = new ContourPoint(new Point(0, laatanKorkeus, 3000), null);
            ContourPoint oikeaYlanurkka = new ContourPoint(new Point(laatanLeveys, laatanKorkeus, 3000), null);
            ContourPoint oikeaAlanurkka = new ContourPoint(new Point(laatanLeveys, 0, 3000), null);

            laatta.AddContourPoint(vasenAlanurkka);
            laatta.AddContourPoint(vasenYlanurkka);
            laatta.AddContourPoint(oikeaYlanurkka);
            laatta.AddContourPoint(oikeaAlanurkka);

            laatta.Profile.ProfileString = Asetukset.LaatanPaksuus.ToString();
            if (!string.IsNullOrWhiteSpace(Asetukset.BetoninLujuus.ToString()))
            {
                laatta.Material.MaterialString = betonimateriaalit[Asetukset.BetoninLujuus];
            }
            else
            {
                laatta.Material.MaterialString = "Concrete_Undefined";
            }
            laatta.Position.Depth = Position.DepthEnum.FRONT;

            laatta.Insert();
            malli.CommitChanges();
        }
        public void UT_CutBeamByPart()
        {
            // test 0: обрезаем балку ThisBeam балкой MainBeam
            //.. создаем балку [0, 1000 - 2000,1000] I20 и обрезает ее
            //.. балкой MainBeam [500,0 - 500, 1500] I50
            Point p1 = new Point(0, 3000);
            Point p2 = new Point(2000, 3000);

            ThisBeam = _TS.CreateBeam("ThisBeam", "I20B1_20_93", p1, p2
                                      , PositionDepth: (int)Position.DepthEnum.MIDDLE);

            Point cp1 = new Point(1000, 0);
            Point cp2 = new Point(1000, 4000);

            MainBeam = _TS.CreateBeam("MainBeam", "I50B1_20_93", cp1, cp2
                                      , PositionDepth: (int)Position.DepthEnum.MIDDLE
                                      , Class: BooleanPart.BooleanOperativeClassName);

            ThisBeam = _TS.CutBeamByPart(ThisBeam, MainBeam, false);

            // стираем ThisBeam и MainBeam
            //          ThisBeam.Delete();
            //           MainBeam.Delete();
            //           Model.CommitChanges();

            // test 1: обрезаем балку ThisBeam пластиной Plate
            p1       = new Point(3000, 2000, 1000);
            p2       = new Point(5000, 1000, 0);
            ThisBeam = _TS.CreateBeam("ThisBeam", "I20B1_20_93", p1, p2);
            ContourPoint c1    = new ContourPoint(new Point(4000, 1000, 0), null);
            ContourPoint c2    = new ContourPoint(new Point(4000, 3000, 0), null);
            ContourPoint c3    = new ContourPoint(new Point(4000, 3000, 2000), null);
            ContourPoint c4    = new ContourPoint(new Point(4000, 1000, 2000), null);
            var          Plate = new ContourPlate();

            Plate.AddContourPoint(c1);
            Plate.AddContourPoint(c2);
            Plate.AddContourPoint(c3);
            Plate.AddContourPoint(c4);
            Plate.Profile.ProfileString   = "PL200";
            Plate.Material.MaterialString = "C245";
            Plate.Class = "2";
            Plate.Name  = "PLATE";
            Plate.Insert();
            Model.CommitChanges();

            ThisBeam = _TS.CutBeamByPart(ThisBeam, Plate, false);

            //         ThisBeam.Delete();
            Plate.Delete();
            Model.CommitChanges();
        }
Example #6
0
        static ContourPlate AddPlate(List <Point> points)
        {
            var contourPlate = new ContourPlate();

            foreach (var point in points)
            {
                var contourPoint = new ContourPoint(point, null);
                contourPlate.AddContourPoint(contourPoint);
            }
            contourPlate.Profile.ProfileString   = "PL100";
            contourPlate.Material.MaterialString = "A36";
            contourPlate.Insert();
            return(contourPlate);
        }
Example #7
0
        static ContourPlate AddCutPlate(List <Point> points)
        {
            var cutPlate = new ContourPlate();

            foreach (var point in points)
            {
                var cutPoint = new ContourPoint(point, null);
                cutPlate.AddContourPoint(cutPoint);
            }
            cutPlate.Profile.ProfileString   = "PL100";
            cutPlate.Material.MaterialString = "A36";
            cutPlate.Class = BooleanPart.BooleanOperativeClassName;
            cutPlate.Insert();
            return(cutPlate);
        }
Example #8
0
        /// <summary>
        /// Создание прямоугольной пластины
        /// </summary>
        /// <param name="startPoint"></param>
        /// <param name="length"></param>
        /// <param name="width"></param>
        /// <returns></returns>
        public static ContourPlate MainPlate(Point startPoint, double length, double width)
        {
            var contourPoint1 = new ContourPoint(startPoint, null);
            var contourPoint2 = new ContourPoint(new Point(startPoint.X + length, startPoint.Y, startPoint.Z), null);
            var contourPoint3 = new ContourPoint(new Point(startPoint.X + length, startPoint.Y + width, startPoint.Z), null);
            var contourPoint4 = new ContourPoint(new Point(startPoint.X, startPoint.Y + width, startPoint.Z), null);

            var plate = new ContourPlate();

            plate.Name = "Главная пластина";
            plate.Profile.ProfileString   = "—6";
            plate.Material.MaterialString = "С255";
            plate.Class = "1";
            plate.AddContourPoint(contourPoint1);
            plate.AddContourPoint(contourPoint2);
            plate.AddContourPoint(contourPoint3);
            plate.AddContourPoint(contourPoint4);
            return(plate);
        }
        private Part DrawDownFloor(Point input, Vector alongStairVect, double width, double overlap, string floorProfile, string floorMaterial)
        {
            double ang            = stair.Ang;
            double height         = stair.StartPoint.Z - stair.EndPoint.Z;
            Vector zaxis          = new Vector(0, 0, -1);
            Vector shortEdge      = Vector.Cross(zaxis, alongStairVect);
            Vector shortEdgeLeft  = shortEdge * ((width + 2 * overlap) / 2);
            Vector shortEdgeRight = shortEdgeLeft * (-1);

            double stairLength     = height / Math.Tan(ang * Math.PI / 180);
            Vector longStairVect   = alongStairVect * stairLength;
            Vector heightStairVect = zaxis * height;

            Point hEndPoint  = new Point(input.X + heightStairVect.X, input.Y + heightStairVect.Y, input.Z + heightStairVect.Z);
            Point stairEndPt = new Point(hEndPoint.X + longStairVect.X, hEndPoint.Y + longStairVect.Y, hEndPoint.Z + longStairVect.Z);

            Vector longEdge = new Vector(stair.EndPoint.X - stairEndPt.X, stair.EndPoint.Y - stairEndPt.Y, stair.EndPoint.Z - stairEndPt.Z);

            Point leftNearCornerPt  = new Point(stairEndPt.X + shortEdgeLeft.X, stairEndPt.Y + shortEdgeLeft.Y, stairEndPt.Z + shortEdgeLeft.Z);
            Point rightNearCornerPt = new Point(stairEndPt.X + shortEdgeRight.X, stairEndPt.Y + shortEdgeRight.Y, stairEndPt.Z + shortEdgeRight.Z);
            Point leftFarCornerPt   = new Point(leftNearCornerPt.X + longEdge.X, leftNearCornerPt.Y + longEdge.Y, leftNearCornerPt.Z + longEdge.Z);
            Point rightFarCornerPt  = new Point(rightNearCornerPt.X + longEdge.X, rightNearCornerPt.Y + longEdge.Y, rightNearCornerPt.Z + longEdge.Z);

            ContourPoint leftCpStartPt  = new ContourPoint(leftNearCornerPt, null);
            ContourPoint leftCpEndPt    = new ContourPoint(leftFarCornerPt, null);
            ContourPoint rightCpStartPt = new ContourPoint(rightNearCornerPt, null);
            ContourPoint rightCpEndPt   = new ContourPoint(rightFarCornerPt, null);

            ContourPlate floorBeam = new ContourPlate();

            floorBeam.AddContourPoint(leftCpStartPt);
            floorBeam.AddContourPoint(leftCpEndPt);
            floorBeam.AddContourPoint(rightCpEndPt);
            floorBeam.AddContourPoint(rightCpStartPt);
            floorBeam.Profile.ProfileString   = floorProfile;
            floorBeam.Material.MaterialString = floorMaterial;
            floorBeam.Position.Depth          = Position.DepthEnum.FRONT;

            floorBeam.Insert();

            return(floorBeam);
        }
Example #10
0
        ContourPlate CreateConturePlate(TSM.Beam secondaryBeam, TSM.Beam primaryBeam, double plateThickness, string plateName)
        {
            double secondaryWidth  = 0.0;
            double secondaryHeight = 0.0;


            secondaryBeam.GetReportProperty("WIDTH", ref secondaryWidth);
            secondaryBeam.GetReportProperty("HEIGHT", ref secondaryHeight);


            //TSG.Point p1 = new TSG.Point(secondaryWidth / 2, 0, secondaryHeight / 2);
            //TSG.Point p2 = new TSG.Point(secondaryWidth / 2, 0, -secondaryHeight / 2);
            //TSG.Point p3 = new TSG.Point(-secondaryWidth / 2, 0, -secondaryHeight / 2);
            //TSG.Point p4 = new TSG.Point(-secondaryWidth / 2, 0, secondaryHeight / 2);

            TSG.Point p1 = new TSG.Point(0, secondaryHeight / 2, secondaryWidth / 2);
            TSG.Point p2 = new TSG.Point(0, -secondaryHeight / 2, secondaryWidth / 2);
            TSG.Point p3 = new TSG.Point(0, -secondaryHeight / 2, -secondaryWidth / 2);
            TSG.Point p4 = new TSG.Point(0, secondaryHeight / 2, -secondaryWidth / 2);

            ContourPlate CP            = new ContourPlate();
            ContourPoint conturePoint1 = new ContourPoint(p1, null);
            ContourPoint conturePoint2 = new ContourPoint(p2, null);
            ContourPoint conturePoint3 = new ContourPoint(p3, null);
            ContourPoint conturePoint4 = new ContourPoint(p4, null);

            CP.AddContourPoint(conturePoint1);
            CP.AddContourPoint(conturePoint2);
            CP.AddContourPoint(conturePoint3);
            CP.AddContourPoint(conturePoint4);
            CP.Name   = plateName;
            CP.Finish = "xxx";
            CP.Profile.ProfileString   = "PL" + plateThickness;
            CP.Material.MaterialString = "S235";
            CP.Position.Depth          = Position.DepthEnum.FRONT;



            return(CP);
        }
        private Part DrawStep(Point input, Vector shortEdge, double width, double length, string floorProfile)
        {
            Vector zaxis           = new Vector(0, 0, -1);
            Vector longEdgeLeftDir = Vector.Cross(zaxis, shortEdge);

            longEdgeLeftDir = longEdgeLeftDir * (length / 2);
            Vector longEdgeRightDir = longEdgeLeftDir * (-1);

            shortEdge = shortEdge * width * (-1);
            Vector ortVect = zaxis * 50;

            leftMiddlePt = new Point(input.X + longEdgeLeftDir.X, input.Y + longEdgeLeftDir.Y, input.Z + longEdgeLeftDir.Z);
            leftEndPt    = new Point(leftMiddlePt.X + shortEdge.X, leftMiddlePt.Y + shortEdge.Y, leftMiddlePt.Z + shortEdge.Z);
            leftStartPt  = new Point(leftMiddlePt.X + ortVect.X, leftMiddlePt.Y + ortVect.Y, leftMiddlePt.Z + ortVect.Z);

            rightMiddlePt = new Point(input.X + longEdgeRightDir.X, input.Y + longEdgeRightDir.Y, input.Z + longEdgeRightDir.Z);
            rightEndPt    = new Point(rightMiddlePt.X + shortEdge.X, rightMiddlePt.Y + shortEdge.Y, rightMiddlePt.Z + shortEdge.Z);
            rightStartPt  = new Point(rightMiddlePt.X + ortVect.X, rightMiddlePt.Y + ortVect.Y, rightMiddlePt.Z + ortVect.Z);

            TSM.PolyBeam stepPolyBeam    = new TSM.PolyBeam(PolyBeam.PolyBeamTypeEnum.BEAM);
            ContourPoint middleContourPt = new ContourPoint(rightMiddlePt, null);
            ContourPoint endContourPt    = new ContourPoint(rightEndPt, null);
            ContourPoint startContourPt  = new ContourPoint(rightStartPt, null);

            stepPolyBeam.Class = "1";
            stepPolyBeam.Name  = "Ступень";
            stepPolyBeam.AddContourPoint(endContourPt);
            stepPolyBeam.AddContourPoint(middleContourPt);
            stepPolyBeam.AddContourPoint(startContourPt);
            stepPolyBeam.Position.Plane          = TSM.Position.PlaneEnum.RIGHT;
            stepPolyBeam.Position.Depth          = Position.DepthEnum.BEHIND;
            stepPolyBeam.Position.Rotation       = TSM.Position.RotationEnum.FRONT;
            stepPolyBeam.Profile.ProfileString   = $"PL4*{length}";
            stepPolyBeam.Material.MaterialString = "Риф4";
            stepPolyBeam.Finish = "PAINT";
            stepPolyBeam.Insert();

            return(stepPolyBeam);
        }
Example #12
0
        public void CK08_CreatePlate()
        {
            ArrayList PickedPoints = null;
            Picker    Picker       = new Picker();

            try
            {
                PickedPoints = Picker.PickPoints(Picker.PickPointEnum.PICK_POLYGON);
            }
            catch { PickedPoints = null; }
            if (PickedPoints != null)
            {
                ContourPlate Plate = new ContourPlate();
                Plate.AssemblyNumber.Prefix      = "P";
                Plate.AssemblyNumber.StartNumber = 1;
                Plate.PartNumber.Prefix          = "p";
                Plate.PartNumber.StartNumber     = 1;
                Plate.Name = "PLATE";
                Plate.Profile.ProfileString   = "PL25";
                Plate.Material.MaterialString = "C245";
                Plate.Finish         = "";
                Plate.Class          = "1";
                Plate.Position.Depth = Position.DepthEnum.FRONT;
                foreach (T3D.Point ThisPoint in PickedPoints)
                {
                    var chamfer     = new Chamfer(12.7, 12.7, Chamfer.ChamferTypeEnum.CHAMFER_LINE);
                    var conturPoint = new ContourPoint(ThisPoint, chamfer);
                    Plate.AddContourPoint(conturPoint);
                }
                if (!Plate.Insert())
                {
                    Tekla.Structures.Model.Operations.Operation.DisplayPrompt("Plate wasn't created.");
                }
                else
                {
                    // Change the workplane to the coordinate system of the plate.
                    var transformationPlane = new TransformationPlane(Plate.GetCoordinateSystem());
                    Model.GetWorkPlaneHandler().SetCurrentTransformationPlane(transformationPlane);

                    // Show the plate in the model and the workplane change.
                    Model.CommitChanges();

                    // This gets the plate's coordinates and information in the current workplane.
                    Plate.Select();
                    ReperShow(Plate.GetCoordinateSystem());
                    // Draw the coordinate of the plate in the model in the local coordinate system.
                    GraphicsDrawer Drawer = new GraphicsDrawer();
                    foreach (ContourPoint ContourPoint in Plate.Contour.ContourPoints)
                    {
                        double    x = ContourPoint.X, y = ContourPoint.Y, z = ContourPoint.Z;
                        T3D.Point CornerPoint = new T3D.Point(x, y, z);
                        PointXYZ(ContourPoint);
                        //double ImperialValue = 25.4;
                        //double XValue = Math.Round(CornerPoint.X / ImperialValue, 4);
                        //double YValue = Math.Round(CornerPoint.Y / ImperialValue, 4);
                        //double ZValue = Math.Round(CornerPoint.Z / ImperialValue, 4);
                        //Drawer.DrawText(CornerPoint, "(" + XValue + "," + YValue + "," + ZValue + ")", new Color(1,0,0));
                        Drawer.DrawLineSegment(new LineSegment(new T3D.Point(0, 0, 0), new T3D.Point(0, 0, 500)), new Color(1, 0, 0));
                    }
                    mw.Msg("На экране Tekla построена пластина по заданным точкам"
                           + " и показаны координаты этих точек и репер ПСК.  [OK]");
                    MessageBox.Show("Построена пластина.");
                    mw.Msg();
                }
            }
        }
Example #13
0
        private void CreatePadFootings(object sender, EventArgs e)
        {
            // Always remember to check that you really have working connection
            if (MyModel.GetConnectionStatus())
            {
                double wsp3 = int.Parse(textBox1.Text);
                double wsp4 = double.Parse(textBox2.Text);

                Picker piku = new Picker();

                //askjdhygausgfdyzjusrgfafsa
                ArrayList info = new ArrayList();
                info = new ArrayList {
                    "END_X", "END_Y", "END_Z", "START_X", "START_Y", "START_Z"
                };
                ArrayList info2 = new ArrayList();
                info2 = new ArrayList {
                    "END_X", "END_Y", "END_Z", "START_X", "START_Y", "START_Z"
                };
                ModelObject part  = new Beam();
                ModelObject part2 = new Beam();
                Hashtable   p1    = new Hashtable();
                Hashtable   p2    = new Hashtable();

                part = piku.PickObject(Picker.PickObjectEnum.PICK_ONE_PART);
                part.GetDoubleReportProperties(info, ref p1);
                part2 = piku.PickObject(Picker.PickObjectEnum.PICK_ONE_PART);
                part2.GetDoubleReportProperties(info2, ref p2);
                Point st1 = new Point();
                Point st2 = new Point();
                st1 = piku.PickPoint();
                st2 = piku.PickPoint();
                Point st3 = new Point(st1);
                Point st4 = new Point(st2);

                //wektory belek
                Vector v1 = new Vector((Convert.ToDouble(p1["START_X"]) - Convert.ToDouble(p1["END_X"])) / 10000, (Convert.ToDouble(p1["START_Y"]) - Convert.ToDouble(p1["END_Y"])) / 10000, (Convert.ToDouble(p1["START_Z"]) - Convert.ToDouble(p1["END_Z"])) / 10000);
                Vector v2 = new Vector((Convert.ToDouble(p2["START_X"]) - Convert.ToDouble(p2["END_X"])) / 10000, (Convert.ToDouble(p2["START_Y"]) - Convert.ToDouble(p2["END_Y"])) / 10000, (Convert.ToDouble(p2["START_Z"]) - Convert.ToDouble(p2["END_Z"])) / 10000);
                double v1d = v1.GetLength(); double ile1 = 30 / v1d;
                double v2d = v2.GetLength(); double ile2 = 30 / v2d;
                double v1dd = v1.GetLength(); double ile3 = wsp4 / v1d;
                double v2dd = v2.GetLength(); double ile4 = wsp4 / v2d;

                st3.Translate((-v1.X) * ile3, (-v1.Y) * ile3, (-v1.Z) * ile3);
                st1.Translate((v1.X) * ile1, (v1.Y) * ile1, (v1.Z) * ile1);
                st4.Translate((-v2.X) * ile2, (-v2.Y) * ile2, (-v2.Z) * ile2);
                st2.Translate((v2.X) * ile4, (v2.Y) * ile4, (v2.Z) * ile4);

                Contour      testowy = new Contour();
                ContourPoint point1  = new ContourPoint(st1, null);
                ContourPoint point2  = new ContourPoint(st3, new Chamfer(45, 0, Chamfer.ChamferTypeEnum.CHAMFER_ROUNDING));
                ContourPoint point3  = new ContourPoint(st4, null);
                testowy.AddContourPoint(point1);
                testowy.AddContourPoint(point2);
                testowy.AddContourPoint(point3);

                Contour      testowy3 = new Contour();
                ContourPoint point10  = new ContourPoint(st4, null);
                ContourPoint point20  = new ContourPoint(st2, new Chamfer(45, 0, Chamfer.ChamferTypeEnum.CHAMFER_ROUNDING));
                ContourPoint point30  = new ContourPoint(st3, null);
                testowy3.AddContourPoint(point10);
                testowy3.AddContourPoint(point20);
                testowy3.AddContourPoint(point30);

                bool strona = radioButton1.Checked;

                ModelObject nb  = CreateBlacha(testowy, strona);
                ModelObject nb3 = CreateBlacha(testowy3, strona);
                nb.Insert();
                nb3.Insert();

                double l1 = 0.0;
                nb.GetReportProperty("LENGTH", ref l1);


                double l2 = 0.0;
                nb3.GetReportProperty("LENGTH", ref l2);

                nb.Delete();
                nb3.Delete();



                Contour testowy2 = new Contour();
                testowy2.AddContourPoint(point1);
                testowy2.AddContourPoint(point2);
                Point        point4v = new Point(dlugosc(point2, point3, l1));
                ContourPoint point4  = new ContourPoint(point4v, null);
                testowy2.AddContourPoint(point4);
                ModelObject nb2 = CreateBlacha(testowy2, strona);

                Contour testowy4 = new Contour();
                testowy4.AddContourPoint(point10);
                testowy4.AddContourPoint(point20);
                Point        point40v = new Point(dlugosc(point20, point30, l2));
                ContourPoint point40  = new ContourPoint(point40v, null);
                testowy4.AddContourPoint(point40);
                ModelObject nb4 = CreateBlacha(testowy4, strona);


                nb2.Insert();
                BoltArray b2 = sruby(point1, point2, nb2 as Part);
                b2.PartToBoltTo = part as Part;
                b2.BoltSize     = Convert.ToDouble(comboBox3.Text);
                b2.BoltStandard = comboBox2.Text;
                b2.Insert();
                nb4.Insert();
                BoltArray b4 = sruby(point10, point20, nb4 as Part);
                b4.BoltSize     = Convert.ToDouble(comboBox3.Text);
                b4.BoltStandard = comboBox2.Text;
                b4.PartToBoltTo = part2 as Part;
                b4.Insert();

                Point point4st  = new Point(dlugosc(point40, point4, 130));
                Point point40st = new Point(dlugosc(point4, point40, 130));

                Point pointsplit = new Point(dlugosc(point4st, point40st, wsp3 + 180));

                if (comboBox1.Text == "D16")
                {
                    Beam st16 = CreateStezenie16(point4st, point40st, strona);
                    st16.Insert();
                    Weld w  = new Weld();
                    Weld w2 = new Weld();
                    w.MainObject      = st16;
                    w.SecondaryObject = nb2;
                    w.ShopWeld        = true;
                    w.Insert();
                    w2.MainObject      = st16;
                    w2.SecondaryObject = nb4;
                    w2.ShopWeld        = true;
                    w2.Insert();
                    Beam       st161 = Operation.Split(st16, pointsplit);
                    Connection sr    = new Connection();
                    sr.Name   = "Po³¹czenie œrub¹ rzymsk¹";
                    sr.Number = 126;
                    sr.LoadAttributesFromFile("82269_M16");
                    sr.SetPrimaryObject(st161);
                    sr.SetSecondaryObject(st16);
                    sr.Insert();
                }
                if (comboBox1.Text == "D20")
                {
                    Beam st16 = CreateStezenie20(point4st, point40st, strona);
                    st16.Insert();
                    Weld w  = new Weld();
                    Weld w2 = new Weld();
                    w.MainObject      = st16;
                    w.SecondaryObject = nb2;
                    w.ShopWeld        = true;
                    w.Insert();
                    w2.MainObject      = st16;
                    w2.SecondaryObject = nb4;
                    w2.ShopWeld        = true;
                    w2.Insert();
                    Beam       st161 = Operation.Split(st16, pointsplit);
                    Connection sr    = new Connection();
                    sr.Name   = "Po³¹czenie œrub¹ rzymsk¹";
                    sr.Number = 126;
                    sr.LoadAttributesFromFile("82269_M20");
                    sr.SetPrimaryObject(st161);
                    sr.SetSecondaryObject(st16);
                    sr.Insert();
                }
                if (comboBox1.Text == "D12")
                {
                    Beam st16 = CreateStezenie12(point4st, point40st, strona);
                    st16.Insert();
                    Weld w  = new Weld();
                    Weld w2 = new Weld();
                    w.MainObject      = st16;
                    w.SecondaryObject = nb2;
                    w.ShopWeld        = true;
                    w.Insert();
                    w2.MainObject      = st16;
                    w2.SecondaryObject = nb4;
                    w2.ShopWeld        = true;
                    w2.Insert();
                    Beam       st161 = Operation.Split(st16, pointsplit);
                    Connection sr    = new Connection();
                    sr.Name   = "Po³¹czenie œrub¹ rzymsk¹";
                    sr.Number = 126;
                    sr.LoadAttributesFromFile("82269_M12");
                    sr.SetPrimaryObject(st161);
                    sr.SetSecondaryObject(st16);
                    sr.Insert();
                }
            }
            MyModel.CommitChanges();
        }
        public static void AddContourPoint(this ContourPlate cp, Point p, Chamfer chamfer = null)
        {
            var cPoint = new ContourPoint(p, chamfer);

            cp.AddContourPoint(cPoint);
        }
Example #15
0
        public void Create()
        {
            Point  Point1              = StartPoint;
            Point  Point2              = EndPoint;
            Vector mainVector          = new Vector(Point2.X - Point1.X, Point2.Y - Point1.Y, Point2.Z - Point1.Z);
            Vector zaxis               = new Vector(0, 0, -1);
            double height              = Point1.Z - Point2.Z;
            Vector heightStair         = zaxis * height;
            Point  heightStairEndPt    = new Point(Point1.X + heightStair.X, Point1.Y + heightStair.Y, Point1.Z + heightStair.Z);
            Vector subMainVector       = new Vector(Point2.X - heightStairEndPt.X, Point2.Y - heightStairEndPt.Y, Point2.Z - heightStairEndPt.Z);
            double stairLength         = height / Math.Tan(Ang * Math.PI / 180);
            Vector normallengthStair   = subMainVector.GetNormal();
            Vector lengthStair         = normallengthStair * stairLength;
            Point  lengthStairEndPoint = new Point(heightStairEndPt.X + lengthStair.X, heightStairEndPt.Y + lengthStair.Y, heightStairEndPt.Z + lengthStair.Z);
            Vector mainStairVector     = new Vector(lengthStairEndPoint.X - Point1.X, lengthStairEndPoint.Y - Point1.Y, lengthStairEndPoint.Z - Point1.Z);

            // offset along length stair
            Vector offsetVect = normallengthStair * Offset;

            Point  stairEndPt    = new Point(lengthStairEndPoint.X + offsetVect.X, lengthStairEndPoint.Y + offsetVect.Y, lengthStairEndPoint.Z + offsetVect.Z);
            Vector stairTailVect = new Vector(Point2.X - stairEndPt.X, Point2.Y - stairEndPt.Y, Point2.Z - stairEndPt.Z);
            double lengthTail    = stairTailVect.GetLength();

            Vector leftOffsetVector       = Vector.Cross(heightStair, mainVector);
            Vector normalOffsetBeamVector = leftOffsetVector.GetNormal();

            leftOffsetVector = normalOffsetBeamVector * (Width / 2);
            Vector horizontalVector       = normallengthStair * (-1);
            Vector horizontalVectorLength = horizontalVector * Offset;
            Point  leftBeamMidlePt        = new Point(Point1.X + leftOffsetVector.X, Point1.Y + leftOffsetVector.Y, Point1.Z + leftOffsetVector.Z);
            Point  leftBeamStartPt        = new Point(leftBeamMidlePt.X + horizontalVectorLength.X, leftBeamMidlePt.Y + horizontalVectorLength.Y, leftBeamMidlePt.Z + horizontalVectorLength.Z);
            Point  leftBeamEndPt          = new Point(lengthStairEndPoint.X + leftOffsetVector.X, lengthStairEndPoint.Y + leftOffsetVector.Y, lengthStairEndPoint.Z + leftOffsetVector.Z);

            Vector rightOffsetVector = leftOffsetVector * (-1);
            Point  rightBeamMidlePt  = new Point(Point1.X + rightOffsetVector.X, Point1.Y + rightOffsetVector.Y, Point1.Z + rightOffsetVector.Z);
            Point  rightBeamStartPt  = new Point(rightBeamMidlePt.X + horizontalVectorLength.X, rightBeamMidlePt.Y + horizontalVectorLength.Y, rightBeamMidlePt.Z + horizontalVectorLength.Z);
            Point  rightBeamEndPt    = new Point(lengthStairEndPoint.X + rightOffsetVector.X, lengthStairEndPoint.Y + rightOffsetVector.Y, lengthStairEndPoint.Z + rightOffsetVector.Z);


            Point leftBeamMidlePtOffset = new Point(leftBeamMidlePt.X + offsetVect.X, leftBeamMidlePt.Y + offsetVect.Y, leftBeamMidlePt.Z + offsetVect.Z);
            Point leftBeamStartPtOffset = new Point(leftBeamStartPt.X + offsetVect.X, leftBeamStartPt.Y + offsetVect.Y, leftBeamStartPt.Z + offsetVect.Z);
            Point leftBeamEndPtOffset   = new Point(leftBeamEndPt.X + offsetVect.X, leftBeamEndPt.Y + offsetVect.Y, leftBeamEndPt.Z + offsetVect.Z);
            Point leftTailEndPoint      = new Point(leftBeamEndPtOffset.X + stairTailVect.X, leftBeamEndPtOffset.Y + stairTailVect.Y, leftBeamEndPtOffset.Z + stairTailVect.Z);

            Point rightBeamMidlePtOffset = new Point(rightBeamMidlePt.X + offsetVect.X, rightBeamMidlePt.Y + offsetVect.Y, rightBeamMidlePt.Z + offsetVect.Z);
            Point rightBeamStartPtOffset = new Point(rightBeamStartPt.X + offsetVect.X, rightBeamStartPt.Y + offsetVect.Y, rightBeamStartPt.Z + offsetVect.Z);
            Point rightBeamEndPtOffset   = new Point(rightBeamEndPt.X + offsetVect.X, rightBeamEndPt.Y + offsetVect.Y, rightBeamEndPt.Z + offsetVect.Z);
            Point rightTailEndPoint      = new Point(rightBeamEndPtOffset.X + stairTailVect.X, rightBeamEndPtOffset.Y + stairTailVect.Y, rightBeamEndPtOffset.Z + stairTailVect.Z);

            TSM.Beam     centerLineBeam = new TSM.Beam(Point1, lengthStairEndPoint);
            TSM.PolyBeam rightPolyBeam  = new TSM.PolyBeam(PolyBeam.PolyBeamTypeEnum.BEAM);
            TSM.PolyBeam leftPolyBeam   = new TSM.PolyBeam(PolyBeam.PolyBeamTypeEnum.BEAM);

            ContourPoint rightBeamPt1 = new ContourPoint(rightBeamStartPtOffset, null);
            ContourPoint rightBeamPt2 = new ContourPoint(rightBeamMidlePtOffset, null);
            ContourPoint rightBeamPt3 = new ContourPoint(rightBeamEndPtOffset, null);
            ContourPoint rightBeamPt4 = new ContourPoint(rightTailEndPoint, null);

            ContourPoint leftBeamPt1 = new ContourPoint(leftBeamStartPtOffset, null);
            ContourPoint leftBeamPt2 = new ContourPoint(leftBeamMidlePtOffset, null);
            ContourPoint leftBeamPt3 = new ContourPoint(leftBeamEndPtOffset, null);
            ContourPoint leftBeamPt4 = new ContourPoint(leftTailEndPoint, null);

            // build right kosour
            rightPolyBeam.Class = "11";
            rightPolyBeam.AddContourPoint(leftBeamPt1);
            rightPolyBeam.AddContourPoint(leftBeamPt2);
            rightPolyBeam.AddContourPoint(leftBeamPt3);
            rightPolyBeam.AddContourPoint(leftBeamPt4);
            rightPolyBeam.Position.Plane          = TSM.Position.PlaneEnum.RIGHT;
            rightPolyBeam.Position.Depth          = Position.DepthEnum.BEHIND;
            rightPolyBeam.Position.Rotation       = TSM.Position.RotationEnum.TOP;
            rightPolyBeam.Profile.ProfileString   = Profile;
            rightPolyBeam.Material.MaterialString = Material;
            rightPolyBeam.Finish = "PAINT";
            rightPolyBeam.Insert();

            MainStringer = rightPolyBeam;

            // build left kosour
            leftPolyBeam.Class = "11";
            leftPolyBeam.AddContourPoint(rightBeamPt1);
            leftPolyBeam.AddContourPoint(rightBeamPt2);
            leftPolyBeam.AddContourPoint(rightBeamPt3);
            leftPolyBeam.AddContourPoint(rightBeamPt4);
            leftPolyBeam.Position.Plane          = TSM.Position.PlaneEnum.LEFT;
            leftPolyBeam.Position.Depth          = Position.DepthEnum.BEHIND;
            leftPolyBeam.Position.Rotation       = TSM.Position.RotationEnum.BELOW;
            leftPolyBeam.Profile.ProfileString   = Profile;
            leftPolyBeam.Material.MaterialString = Material;
            leftPolyBeam.Finish = "PAINT";
            leftPolyBeam.Insert();

            SecondStringer = leftPolyBeam;

            double hprofile = 0;

            rightPolyBeam.GetReportProperty("HEIGHT", ref hprofile);
            Vector hOrtVect = zaxis * hprofile;

            Point stepsOffsetZPt = new Point(Point1.X + hOrtVect.X, Point1.Y + hOrtVect.Y, Point1.Z + hOrtVect.Z);
            //   var offsetStep = lengthStartSegment - ( hprofile / Math.Tan( (90.0 - ang /2) * Math.PI / 180) );
            var    offsetStep      = Offset;
            Vector offsetStepsVect = normallengthStair * offsetStep;

            StartStepsPoint = new Point(Point1.X + offsetStepsVect.X, Point1.Y + offsetStepsVect.Y, Point1.Z + offsetStepsVect.Z);
            //Height = height - hprofile;
            StairVector = normallengthStair;
        }
Example #16
0
        public override bool Run(List <InputDefinition> Input)
        {
            try
            {
                // 오버라이드 된 DefineInput에서 List를 가져옴
                // purlin = 중도리 지붕을 지탱하는 골조
                // flange = 플랜지 파이프를 연결하기 위한 배관?
                Beam Purlin1 = (Beam)_model.SelectModelObject((Identifier)Input[0].GetInput());
                Beam Purlin2 = (Beam)_model.SelectModelObject((Identifier)Input[1].GetInput());
                Beam OFlange = (Beam)_model.SelectModelObject((Identifier)Input[2].GetInput());
                Beam Web     = (Beam)_model.SelectModelObject((Identifier)Input[3].GetInput());
                Beam IFlange = (Beam)_model.SelectModelObject((Identifier)Input[4].GetInput());

                // 초기값 체크
                GetValuesFromDialog();

                double WebThick     = 0.0;
                double IFlangeWidth = 0.0;
                double IFlangeThick = 0.0;
                double OFlangeThick = 0.0;
                Web.GetReportProperty("WIDTH", ref WebThick);
                OFlange.GetReportProperty("WIDTH", ref OFlangeThick);
                IFlange.GetReportProperty("WIDTH", ref IFlangeThick);
                IFlange.GetReportProperty("HEIGHT", ref IFlangeWidth);

                if (IsDefaultValue(_PlateWidth) || _PlateWidth == 0)
                {
                    _PlateWidth = (IFlangeWidth - WebThick) * 0.5;
                }
                if (IsDefaultValue(_PlateLength) || _PlateLength == 0)
                {
                    _PlateLength = (IFlangeWidth - WebThick) * 0.5;
                }

                CoordinateSystem WebSys = Web.GetCoordinateSystem();

                // 평면(Web)과 선(purlin1의 시작과 끝점)이 만나는 교차점
                T3D.Point TopCenter = T3D.Intersection.LineToPlane(new Line(Purlin1.StartPoint, Purlin1.EndPoint), new GeometricPlane(WebSys.Origin, WebSys.AxisX, WebSys.AxisY));

                // 실제 좌표점(x,y,z)
                CoordinateSystem WorkSystem = new CoordinateSystem(TopCenter, WebSys.AxisX.Cross(WebSys.AxisY), WebSys.AxisY);

                // CoordinateSystem의 실좌표를 Plane 변경
                _model.GetWorkPlaneHandler().SetCurrentTransformationPlane(new TransformationPlane(WorkSystem));

                Purlin1.Select();
                Purlin2.Select();
                Web.Select();
                OFlange.Select();
                IFlange.Select();

                CoordinateSystem PurSys        = Purlin1.GetCoordinateSystem();
                T3D.Point        TopClipCenter = T3D.Intersection.LineToPlane(new Line(OFlange.StartPoint, OFlange.EndPoint), new GeometricPlane(PurSys.Origin, PurSys.AxisX, PurSys.AxisY));
                T3D.Point        BottCenter    = T3D.Intersection.LineToPlane(new Line(IFlange.StartPoint, IFlange.EndPoint), new GeometricPlane(PurSys.Origin, PurSys.AxisX, PurSys.AxisY));

                T3D.Point LeftAngleFirstPoint   = new T3D.Point(-_UpperHorizontalDistance, _UpperVerticalDistance, 0);
                T3D.Point LeftAngleSecondPoint  = new T3D.Point(-_LowerHorizontalDistance, BottCenter.Y - IFlangeThick + _LowerVerticalDistance, 0);
                T3D.Point RightAngleFirstPoint  = new T3D.Point(_UpperHorizontalDistance, _UpperVerticalDistance, 0);
                T3D.Point RightAngleSecondPoint = new T3D.Point(_LowerHorizontalDistance, BottCenter.Y - IFlangeThick + _LowerVerticalDistance, 0);

                Beam         LeftAngle  = new Beam();
                Beam         RightAngle = new Beam();
                Beam         TopClip    = new Beam();
                ContourPlate LeftPlate  = new ContourPlate();
                ContourPlate RightPlate = new ContourPlate();

                TopClip.StartPoint = new T3D.Point(-_TopClipLength * 0.5, TopClipCenter.Y + OFlangeThick, 0);
                TopClip.EndPoint   = new T3D.Point(_TopClipLength * 0.5, TopClipCenter.Y + OFlangeThick, 0);

                if (PurSys.AxisX.GetNormal() == new Vector(1, 0, 0) && PurSys.AxisY.GetNormal() == new Vector(0, 1, 0))
                {
                    LeftAngle.StartPoint         = LeftAngleSecondPoint;
                    LeftAngle.EndPoint           = LeftAngleFirstPoint;
                    RightAngle.StartPoint        = RightAngleFirstPoint;
                    RightAngle.EndPoint          = RightAngleSecondPoint;
                    LeftAngle.Position.Plane     = Position.PlaneEnum.LEFT;
                    LeftAngle.Position.Rotation  = Position.RotationEnum.BELOW;
                    LeftAngle.Position.Depth     = Position.DepthEnum.BEHIND;
                    RightAngle.Position.Plane    = Position.PlaneEnum.LEFT;
                    RightAngle.Position.Rotation = Position.RotationEnum.BELOW;
                    RightAngle.Position.Depth    = Position.DepthEnum.BEHIND;
                    TopClip.Position.Plane       = Position.PlaneEnum.LEFT;
                    TopClip.Position.Rotation    = Position.RotationEnum.FRONT;
                    TopClip.Position.Depth       = Position.DepthEnum.BEHIND;
                    LeftPlate.Position.Depth     = Position.DepthEnum.FRONT;
                    RightPlate.Position.Depth    = Position.DepthEnum.FRONT;
                }
                else
                {
                    LeftAngle.StartPoint         = LeftAngleFirstPoint;
                    LeftAngle.EndPoint           = LeftAngleSecondPoint;
                    RightAngle.StartPoint        = RightAngleFirstPoint;
                    RightAngle.EndPoint          = RightAngleSecondPoint;
                    LeftAngle.Position.Plane     = Position.PlaneEnum.RIGHT;
                    LeftAngle.Position.Rotation  = Position.RotationEnum.TOP;
                    LeftAngle.Position.Depth     = Position.DepthEnum.FRONT;
                    RightAngle.Position.Plane    = Position.PlaneEnum.RIGHT;
                    RightAngle.Position.Rotation = Position.RotationEnum.FRONT;
                    RightAngle.Position.Depth    = Position.DepthEnum.FRONT;
                    TopClip.Position.Plane       = Position.PlaneEnum.LEFT;
                    TopClip.Position.Rotation    = Position.RotationEnum.FRONT;
                    TopClip.Position.Depth       = Position.DepthEnum.FRONT;
                    LeftPlate.Position.Depth     = Position.DepthEnum.BEHIND;
                    RightPlate.Position.Depth    = Position.DepthEnum.BEHIND;
                }

                LeftAngle.Profile.ProfileString   = _FlangeProfile;
                LeftAngle.Material.MaterialString = _FlangeMaterial;
                LeftAngle.Class = _FlangeClass;
                LeftAngle.Name  = _FlangeName;
                LeftAngle.Insert();

                RightAngle.Profile.ProfileString   = _FlangeProfile;
                RightAngle.Material.MaterialString = _FlangeMaterial;
                RightAngle.Class = _FlangeClass;
                RightAngle.Name  = _FlangeName;
                RightAngle.Insert();

                double BraceWidth     = 0.0;
                double BraceThickness = 0.0;
                RightAngle.GetReportProperty("WIDTH", ref BraceWidth);
                RightAngle.GetReportProperty("PROFILE.FLANGE_THICKNESS_1", ref BraceThickness);

                double BoltGauge = (BraceWidth + BraceThickness) * 0.5;
                LeftAngle.Position.PlaneOffset = -BoltGauge;
                LeftAngle.StartPointOffset.Dx  = _UpperBoltHorizontalDistance;
                LeftAngle.EndPointOffset.Dx    = _LowerBoltHorizontalDistance;
                LeftAngle.Modify();
                RightAngle.Position.PlaneOffset = -BoltGauge;
                RightAngle.StartPointOffset.Dx  = -_LowerBoltHorizontalDistance;
                RightAngle.EndPointOffset.Dx    = _UpperBoltHorizontalDistance;
                RightAngle.Modify();

                TopClip.Profile.ProfileString   = "PL" + _TopClipThickness + "*" + _TopClipWidth;
                TopClip.Material.MaterialString = _TopClipMaterial;
                TopClip.Name = _TopClipName;
                TopClip.Insert();

                Point        LeftPlatePoint1        = new Point(BottCenter.X - WebThick * 0.5, BottCenter.Y, 0);
                Point        LeftPlatePoint2        = new Point(BottCenter.X - WebThick * 0.5, BottCenter.Y + _PlateLength, 0);
                Point        LeftPlatePoint3        = new Point(BottCenter.X - WebThick * 0.5 - _PlateWidth, BottCenter.Y + _PlateLength, 0);
                Point        LeftPlatePoint4        = new Point(BottCenter.X - WebThick * 0.5 - _PlateWidth, BottCenter.Y, 0);
                ContourPoint LeftPlateContourPoint1 = new ContourPoint(LeftPlatePoint1, new Chamfer(30, 30, Chamfer.ChamferTypeEnum.CHAMFER_LINE));
                ContourPoint LeftPlateContourPoint2 = new ContourPoint(LeftPlatePoint2, new Chamfer());
                ContourPoint LeftPlateContourPoint3 = new ContourPoint(LeftPlatePoint3, new Chamfer());
                ContourPoint LeftPlateContourPoint4 = new ContourPoint(LeftPlatePoint4, new Chamfer());
                LeftPlate.AddContourPoint(LeftPlateContourPoint1);
                LeftPlate.AddContourPoint(LeftPlateContourPoint2);
                LeftPlate.AddContourPoint(LeftPlateContourPoint3);
                LeftPlate.AddContourPoint(LeftPlateContourPoint4);
                LeftPlate.Material.MaterialString = _PlateMaterial;
                LeftPlate.Profile.ProfileString   = "PL" + _PlateThickness.ToString();
                LeftPlate.Name = _PlateName;
                LeftPlate.Insert();

                Point        RightPlatePoint1        = new Point(BottCenter.X + WebThick * 0.5, BottCenter.Y, 0);
                Point        RightPlatePoint2        = new Point(RightPlatePoint1.X + _PlateWidth, RightPlatePoint1.Y, 0);
                Point        RightPlatePoint3        = new Point(RightPlatePoint2.X, RightPlatePoint2.Y + _PlateLength, 0);
                Point        RightPlatePoint4        = new Point(RightPlatePoint3.X - _PlateWidth, RightPlatePoint3.Y, 0);
                ContourPoint RightPlateContourPoint1 = new ContourPoint(RightPlatePoint1, new Chamfer(30, 30, Chamfer.ChamferTypeEnum.CHAMFER_LINE));
                ContourPoint RightPlateContourPoint2 = new ContourPoint(RightPlatePoint2, new Chamfer());
                ContourPoint RightPlateContourPoint3 = new ContourPoint(RightPlatePoint3, new Chamfer());
                ContourPoint RightPlateContourPoint4 = new ContourPoint(RightPlatePoint4, new Chamfer());
                RightPlate.AddContourPoint(RightPlateContourPoint1);
                RightPlate.AddContourPoint(RightPlateContourPoint2);
                RightPlate.AddContourPoint(RightPlateContourPoint3);
                RightPlate.AddContourPoint(RightPlateContourPoint4);
                RightPlate.Material.MaterialString = _PlateMaterial;
                RightPlate.Profile.ProfileString   = "PL" + _PlateThickness.ToString();
                RightPlate.Name = _PlateName;
                RightPlate.Insert();

                Beam LeftPurlin  = Purlin1;
                Beam RightPurlin = Purlin2;
                if ((Purlin1.StartPoint.X - Purlin2.StartPoint.X) > 1 || (Purlin1.StartPoint.Y - Purlin2.StartPoint.Y) > 1)
                {
                    RightPurlin = Purlin1;
                    LeftPurlin  = Purlin2;
                }

                Weld LeftPlateToIFlange = new Weld();
                LeftPlateToIFlange.MainObject      = IFlange;
                LeftPlateToIFlange.SecondaryObject = LeftPlate;
                LeftPlateToIFlange.ShopWeld        = true;
                LeftPlateToIFlange.Insert();
                Weld LeftPlateToWeb = new Weld();
                LeftPlateToWeb.MainObject      = Web;
                LeftPlateToWeb.SecondaryObject = LeftPlate;
                LeftPlateToWeb.ShopWeld        = true;
                LeftPlateToWeb.Insert();
                Weld RightPlateToIFlange = new Weld();
                RightPlateToIFlange.MainObject      = IFlange;
                RightPlateToIFlange.SecondaryObject = RightPlate;
                RightPlateToIFlange.ShopWeld        = true;
                RightPlateToIFlange.Insert();
                Weld RightPlateToWeb = new Weld();
                RightPlateToWeb.MainObject      = Web;
                RightPlateToWeb.SecondaryObject = RightPlate;
                RightPlateToWeb.ShopWeld        = true;
                RightPlateToWeb.Insert();

                PolygonWeld ClipToFlange = new PolygonWeld();
                ClipToFlange.TypeAbove       = BaseWeld.WeldTypeEnum.WELD_TYPE_FILLET;
                ClipToFlange.TypeBelow       = BaseWeld.WeldTypeEnum.WELD_TYPE_FILLET;
                ClipToFlange.SizeAbove       = _ClipWeldSize;
                ClipToFlange.SizeBelow       = _ClipWeldSize;
                ClipToFlange.MainObject      = OFlange;
                ClipToFlange.SecondaryObject = TopClip;
                ClipToFlange.ShopWeld        = true;
                ClipToFlange.Polygon.Points.Add(TopClip.StartPoint);
                ClipToFlange.Polygon.Points.Add(TopClip.EndPoint);
                ClipToFlange.Insert();

                // Bolting Brace with Plate or Purlin
                BoltArray UpperLeftBolt = new BoltArray();
                UpperLeftBolt.PartToBoltTo   = LeftPurlin;
                UpperLeftBolt.PartToBeBolted = LeftAngle;
                UpperLeftBolt.FirstPosition  = LeftAngle.StartPoint;
                UpperLeftBolt.SecondPosition = LeftAngle.EndPoint;
                UpperLeftBolt.AddBoltDistX(0.0);
                UpperLeftBolt.AddBoltDistY(0.0);
                UpperLeftBolt.BoltSize          = _BraceBoltSize;
                UpperLeftBolt.Tolerance         = 0.0625 * 25.4;
                UpperLeftBolt.BoltStandard      = _BraceBoltStandard;
                UpperLeftBolt.BoltType          = BoltGroup.BoltTypeEnum.BOLT_TYPE_SITE;
                UpperLeftBolt.CutLength         = 76.2;
                UpperLeftBolt.Bolt              = true;
                UpperLeftBolt.Position.Rotation = Position.RotationEnum.FRONT;
                BoltArray LowerLeftBolt = new BoltArray();
                LowerLeftBolt.PartToBoltTo   = LeftPlate;
                LowerLeftBolt.PartToBeBolted = LeftAngle;
                LowerLeftBolt.FirstPosition  = LeftAngle.EndPoint;
                LowerLeftBolt.SecondPosition = LeftAngle.StartPoint;
                LowerLeftBolt.AddBoltDistX(0.0);
                LowerLeftBolt.AddBoltDistY(0.0);
                LowerLeftBolt.BoltSize          = _BraceBoltSize;
                LowerLeftBolt.BoltStandard      = _BraceBoltStandard;
                LowerLeftBolt.Tolerance         = 0.0625 * 25.4;
                LowerLeftBolt.BoltType          = BoltGroup.BoltTypeEnum.BOLT_TYPE_SITE;
                LowerLeftBolt.CutLength         = 76.2;
                LowerLeftBolt.Bolt              = true;
                LowerLeftBolt.Position.Rotation = Position.RotationEnum.FRONT;
                BoltArray UpperRightBolt = new BoltArray();
                UpperRightBolt.PartToBoltTo   = RightPurlin;
                UpperRightBolt.PartToBeBolted = RightAngle;
                UpperRightBolt.FirstPosition  = RightAngle.EndPoint;
                UpperRightBolt.SecondPosition = RightAngle.StartPoint;
                UpperRightBolt.AddBoltDistX(0.0);
                UpperRightBolt.AddBoltDistY(0.0);
                UpperRightBolt.BoltSize          = _BraceBoltSize;
                UpperRightBolt.Tolerance         = 0.0625 * 25.4;
                UpperRightBolt.BoltStandard      = _BraceBoltStandard;
                UpperRightBolt.BoltType          = BoltGroup.BoltTypeEnum.BOLT_TYPE_SITE;
                UpperRightBolt.CutLength         = 76.2;
                UpperRightBolt.Bolt              = true;
                UpperRightBolt.Position.Rotation = Position.RotationEnum.FRONT;
                BoltArray LowerRightBolt = new BoltArray();
                LowerRightBolt.PartToBoltTo   = RightPlate;
                LowerRightBolt.PartToBeBolted = RightAngle;
                LowerRightBolt.FirstPosition  = RightAngle.StartPoint;
                LowerRightBolt.SecondPosition = RightAngle.EndPoint;
                LowerRightBolt.AddBoltDistX(0.0);
                LowerRightBolt.AddBoltDistY(0.0);
                LowerRightBolt.BoltSize          = _BraceBoltSize;
                LowerRightBolt.Tolerance         = 0.0625 * 25.4;
                LowerRightBolt.BoltStandard      = _BraceBoltStandard;
                LowerRightBolt.BoltType          = BoltGroup.BoltTypeEnum.BOLT_TYPE_SITE;
                LowerRightBolt.CutLength         = 76.2;
                LowerRightBolt.Bolt              = true;
                LowerRightBolt.Position.Rotation = Position.RotationEnum.FRONT;

                // Bolting ClipPlate with purlin
                BoltArray ClipBolts1 = new BoltArray();
                ClipBolts1.PartToBoltTo        = LeftPurlin;
                ClipBolts1.PartToBeBolted      = TopClip;
                ClipBolts1.FirstPosition       = TopClip.StartPoint;
                ClipBolts1.SecondPosition      = TopClip.EndPoint;
                ClipBolts1.StartPointOffset.Dx = 31.75;
                ClipBolts1.AddBoltDistX(0);
                ClipBolts1.AddBoltDistY(76.2);
                ClipBolts1.StartPointOffset.Dy = 76.2;
                ClipBolts1.EndPointOffset.Dy   = 76.2;
                ClipBolts1.BoltSize            = _ClipBoltSize;
                ClipBolts1.Tolerance           = 0.0625 * 25.4;
                ClipBolts1.BoltStandard        = _CliptBoltStandard;
                ClipBolts1.BoltType            = BoltGroup.BoltTypeEnum.BOLT_TYPE_SITE;
                ClipBolts1.CutLength           = 76.2;
                ClipBolts1.Bolt = true;
                ClipBolts1.Position.Rotation = Position.RotationEnum.FRONT;

                BoltArray ClipBolts2 = new BoltArray();
                ClipBolts2.PartToBoltTo        = RightPurlin;
                ClipBolts2.PartToBeBolted      = TopClip;
                ClipBolts2.FirstPosition       = TopClip.StartPoint;
                ClipBolts2.SecondPosition      = TopClip.EndPoint;
                ClipBolts2.StartPointOffset.Dx = _TopClipLength - 31.75;
                ClipBolts2.AddBoltDistX(0);
                ClipBolts2.AddBoltDistY(76.2);
                ClipBolts2.StartPointOffset.Dy = 76.2;
                ClipBolts2.EndPointOffset.Dy   = 76.2;
                ClipBolts2.BoltSize            = _ClipBoltSize;
                ClipBolts2.Tolerance           = 0.0625 * 25.4;
                ClipBolts2.BoltStandard        = _CliptBoltStandard;
                ClipBolts2.BoltType            = BoltGroup.BoltTypeEnum.BOLT_TYPE_SITE;
                ClipBolts2.CutLength           = 76.2;
                ClipBolts2.Bolt = true;
                ClipBolts2.Position.Rotation = Position.RotationEnum.FRONT;

                if (PurSys.AxisX.GetNormal() == new Vector(1, 0, 0) && PurSys.AxisX.GetNormal() == new Vector(0, 1, 0))
                {
                    UpperLeftBolt.FirstPosition      = LeftAngle.EndPoint;
                    UpperLeftBolt.SecondPosition     = LeftAngle.StartPoint;
                    UpperLeftBolt.Position.Rotation  = Position.RotationEnum.BACK;
                    LowerLeftBolt.FirstPosition      = LeftAngle.StartPoint;
                    LowerLeftBolt.SecondPosition     = LeftAngle.EndPoint;
                    LowerLeftBolt.Position.Rotation  = Position.RotationEnum.BACK;
                    UpperRightBolt.FirstPosition     = RightAngle.StartPoint;
                    UpperRightBolt.SecondPosition    = RightAngle.EndPoint;
                    UpperRightBolt.Position.Rotation = Position.RotationEnum.BACK;
                    LowerRightBolt.FirstPosition     = RightAngle.StartPoint;
                    LowerRightBolt.SecondPosition    = RightAngle.EndPoint;
                    LowerRightBolt.Position.Rotation = Position.RotationEnum.BACK;
                    ClipBolts1.Position.Rotation     = Position.RotationEnum.BACK;
                    ClipBolts2.Position.Rotation     = Position.RotationEnum.BACK;
                }
                UpperLeftBolt.Insert();
                LowerLeftBolt.Insert();
                UpperRightBolt.Insert();
                LowerRightBolt.Insert();
                ClipBolts1.Insert();
                ClipBolts2.Insert();
            }
            catch (Exception e)
            {
                MessageBox.Show(e.ToString());
            }

            return(true);
        }