예제 #1
0
        public override bool Run(List <InputDefinition> input)
        {
            try
            {
                Tekla.Structures.Identifier  id    = (Tekla.Structures.Identifier)(input[0]).GetInput();
                Tekla.Structures.Model.Model model = new TSM.Model();
                TSM.Beam beam = (TSM.Beam)model.SelectModelObject(id);

                model.GetWorkPlaneHandler().SetCurrentTransformationPlane(new TSM.TransformationPlane());
                TSM.TransformationPlane currentTP       = model.GetWorkPlaneHandler().GetCurrentTransformationPlane();
                CoordinateSystem        coordenadasMuro = beam.GetCoordinateSystem();
                model.GetWorkPlaneHandler().SetCurrentTransformationPlane(new TSM.TransformationPlane(coordenadasMuro));

                ParametrosPanel p = new ParametrosPanel(beam);
                p.dx                 = data.dx;
                p.dy                 = data.dy;
                p.diametroBarras     = data.diametroBarras;
                p.diametroDiagonal   = data.diametroDiagonales;
                p.adicionalDerecha   = data.largoDerecha;
                p.adicionalIzquierda = data.largoIzquierda;
                p.adicionalSuperior  = data.largoSuperior;
                p.adicionalInferior  = data.largoInferior;

                PanelMoldar panel = new PanelMoldar(p);
                panel.fabricar();

                model.GetWorkPlaneHandler().SetCurrentTransformationPlane(currentTP);
            }
            catch (Exception ex)
            {
                ErrorDialog.Show("Exception", ex.Message, ErrorDialog.Severity.ERROR);
            }

            return(true);
        }
예제 #2
0
 private static void swapBeam(TSM.Beam part)
 {
     T3D.Point startPoint = part.StartPoint;
     T3D.Point endPoint   = part.EndPoint;
     part.StartPoint = endPoint;
     part.EndPoint   = startPoint;
 }
예제 #3
0
 private void CreatBeams(Point Point1, Point Point2, String Profile)
 {
     tsm.Beam mybeams = new tsm.Beam(Point1, Point2);
     mybeams.Profile.ProfileString = Profile;
     mybeams.Finish = "Paint";
     mybeams.Insert();
 }
예제 #4
0
        public TSM.Beam BeamFirst(TSG.Point pointFirst, TSG.Point pointSecond)
        {
            TSM.Beam beam = new TSM.Beam();
            beam.StartPoint = pointFirst;
            beam.EndPoint   = pointSecond;
            if (tb_profileBeams.Text != string.Empty)
            {
                beam.Profile.ProfileString = tb_profileBeams.Text;
            }
            else
            {
                beam.Profile.ProfileString = "HEA300";
            }

            if (tb_materialBeams.Text != string.Empty)
            {
                beam.Material.MaterialString = tb_materialBeams.Text;
            }
            else
            {
                beam.Material.MaterialString = "S235";
            }
            beam.Class          = "3";
            beam.Position.Depth = TSM.Position.DepthEnum.MIDDLE;
            if (tb_nameBeams.Text != string.Empty)
            {
                beam.Name = tb_nameBeams.Text;
            }
            else
            {
                beam.Name = "Beam";
            }

            return(beam);
        }
예제 #5
0
        private void CreateBeam(TSG.Point Point1, TSG.Point Point2)
        {
            TSM.Beam MyBeam = new TSM.Beam(Point1, Point2);

            MyBeam.Profile.ProfileString = _Profile;
            MyBeam.Finish = "PAINT";
            MyBeam.Insert();
        }
예제 #6
0
        private void CreateBeam(TSG.Point Point1, TSG.Point Point2)
        {
            TSM.Beam MyBeam = new TSM.Beam(Point1, Point2);

            MyBeam.Profile.ProfileString = _Profile;
            MyBeam.Class = _Color.ToString();
            MyBeam.Insert();
        }
예제 #7
0
        private void CreateBeam(Point Point1, Point Point2, string profile)
        {
            TSM.Beam MyBeam = new TSM.Beam(Point1, Point2);

            MyBeam.Profile.ProfileString = profile;      //_Profile;
            MyBeam.Finish = "PAINT";
            MyBeam.Insert();
        }
예제 #8
0
        private void btn_createUstirrup_Click(object sender, EventArgs e)
        {
            //기본객체 생성
            RebarGroup rebarGroup = new RebarGroup();
            Picker     picker     = new Picker();

            //부재선택
            TSM.ModelObject mainpart = picker.PickObject(Picker.PickObjectEnum.PICK_ONE_PART, "철근을 삽입할 부재를 선택하세요.");
            TSM.Beam        Beam     = mainpart as TSM.Beam;
            rebarGroup.Father = Beam;

            //철근 형태를 결정할 Point 선택
            ArrayList shapePoints = picker.PickPoints(Picker.PickPointEnum.PICK_POLYGON, "철근 형태를 결정할 포인트를 선택하세요.");

            TSM.Polygon polygon = new TSM.Polygon();
            for (int i = 0; i < shapePoints.Count; i++)
            {
                polygon.Points.Add(shapePoints[i]);
            }
            rebarGroup.Polygons.Add(polygon);

            //철근 생성 위치를 결정할 Point 선택
            ArrayList locationPoints = picker.PickPoints(Picker.PickPointEnum.PICK_POLYGON, "철근 생성 위치를 결정할 포인트를 선택하세요.");

            rebarGroup.StartPoint = (TSG.Point)locationPoints[0];
            rebarGroup.EndPoint   = (TSG.Point)locationPoints[1];

            //RebarInfo 클래스에서 불러올 값
            rebarGroup.Name  = "Rebar";
            rebarGroup.Size  = "13";
            rebarGroup.Grade = "SD400";
            rebarGroup.RadiusValues.Add(60.00);
            rebarGroup.Class = 11;

            //Form에서 설정
            rebarGroup.StartHook.Shape = RebarHookData.RebarHookShapeEnum.HOOK_180_DEGREES;
            rebarGroup.EndHook.Shape   = RebarHookData.RebarHookShapeEnum.HOOK_180_DEGREES;

            rebarGroup.OnPlaneOffsets.Add(25.00);
            rebarGroup.FromPlaneOffset       = 25;
            rebarGroup.StartPointOffsetValue = 25;
            rebarGroup.EndPointOffsetValue   = 25;

            rebarGroup.SpacingType = BaseRebarGroup.RebarGroupSpacingTypeEnum.SPACING_TYPE_TARGET_SPACE;
            rebarGroup.Spacings.Add(200);
            rebarGroup.ExcludeType = BaseRebarGroup.ExcludeTypeEnum.EXCLUDE_TYPE_NONE;
            rebarGroup.StirrupType = RebarGroup.RebarGroupStirrupTypeEnum.STIRRUP_TYPE_POLYGONAL;

            if (!rebarGroup.Insert())
            {
                Console.WriteLine("insert failed");
            }
            else
            {
                model.CommitChanges();
            }
        }
예제 #9
0
        private void WeldBeamToPlate(TSM.Beam beam, TSM.ContourPlate plate)
        {
            TSM.Weld weld = new TSM.Weld();

            weld.MainObject        = beam;
            weld.SecondaryObject   = plate;
            weld.ConnectAssemblies = true;
            weld.SizeAbove         = 5;
            weld.Insert();
        }
예제 #10
0
        /// <summary>
        /// Creates a beam using two input points.
        /// </summary>
        /// <param name="point1">The first input point.</param>
        /// <param name="point2">The second input point.</param>
        private void CreateBeam(Point point1, Point point2)
        {
            var myBeam = new TSM.Beam(point1, point2)
            {
                Profile = { ProfileString = this.profile },
                Finish  = "PAINT"
            };

            myBeam.Insert();
        }
예제 #11
0
        private void CreateWebPlate(TSG.Point Point1, TSG.Point Point2)
        {
            TSM.Beam myBeam = new TSM.Beam(new TSG.Point(Point1), new TSG.Point(Point2));

            string profileString = "Pl" + this.webThickness.ToString() + "*" + (this.webHeight - 2.0 * this.flangeThickness).ToString();

            myBeam.Profile.ProfileString = profileString.Replace(",", ".");
            myBeam.Finish            = "PAINTT";
            myBeam.Position.Depth    = TSM.Position.DepthEnum.MIDDLE;
            myBeam.Position.Plane    = TSM.Position.PlaneEnum.MIDDLE;
            myBeam.Position.Rotation = TSM.Position.RotationEnum.BACK;
            myBeam.Insert();
        }
예제 #12
0
        /// <summary>
        /// Creates a beam using two input points.
        /// </summary>
        /// <param name="point1">The first input point.</param>
        /// <param name="point2">The second input point.</param>
        private void CreateBeam(Point point1, Point point2)
        {
            var myBeam = new TSM.Beam(point1, point2)
            {
                Profile = { ProfileString = this.profile },
                Finish  = "PAINT"
            };

            myBeam.Class = "2";
            myBeam.Material.MaterialString = "Steel_Undefined";
            myBeam.Name = "MyBeam";

            myBeam.Insert();
        }
예제 #13
0
        private void button1_Click(object sender, EventArgs e)
        {
            Model MyModel = new Model();

            TSM.Beam newObject = new TSM.Beam();

            int rowsCount = dataTable.Rows.Count;

            //string fabCode = "";

            if (rowsCount == 0)
            {
                MessageBox.Show("Open the file to proceed!", "COG Message");
            }
            else
            {
                progressBar1.Minimum = 1;
                progressBar1.Maximum = rowsCount;
                progressBar1.Value   = 1;
                progressBar1.Step    = 1;

                for (int i = 0; i < rowsCount; i++)
                {
                    newObject.Name = "COG for: " + dataTable.Rows[i]["Fabrication Code"].ToString();
                    //fabCode = newObject.Name;
                    //Console.WriteLine(newObject.Name + " "  + fabCode);
                    //newObject.SetUserProperty("FABRICATION_CODE", fabCode);
                    newObject.Profile.ProfileString   = "ELD1*1*100*100";//ELD1*15*100*100 d100
                    newObject.Material.MaterialString = "Z35";
                    newObject.Class                 = "1001";
                    newObject.PartNumber.Prefix     = "cog";
                    newObject.AssemblyNumber.Prefix = "COG";
                    newObject.StartPoint.X          = Convert.ToDouble(dataTable.Rows[i]["COG X"]);
                    newObject.StartPoint.Y          = Convert.ToDouble(dataTable.Rows[i]["COG Y"]);
                    newObject.StartPoint.Z          = Convert.ToDouble(dataTable.Rows[i]["COG Z"]);
                    newObject.EndPoint.X            = Convert.ToDouble(dataTable.Rows[i]["COG X"]);
                    newObject.EndPoint.Y            = Convert.ToDouble(dataTable.Rows[i]["COG Y"]);
                    newObject.EndPoint.Z            = Convert.ToDouble(dataTable.Rows[i]["COG Z"]) + 100;
                    newObject.Position.Rotation     = Position.RotationEnum.TOP;
                    newObject.Position.Plane        = Position.PlaneEnum.MIDDLE;
                    newObject.Position.Depth        = Position.DepthEnum.MIDDLE;

                    newObject.Insert();
                    progressBar1.PerformStep();
                    textBox2.Text = rowsCount + " " + "COGs created";
                }
                MyModel.CommitChanges();
            }
        }
예제 #14
0
        public static bool CreateBeam()
        {
            TSM.Model myModel = new TSM.Model();
            TSM.Beam  myBeam  = new TSM.Beam(new TSG3d.Point(1000, 1000, 1000),
                                             new TSG3d.Point(6000, 6000, 1000));
            myBeam.Material.MaterialString = "Concrete_Undefined";
            myBeam.Profile.ProfileString   = "800*400";
            bool creationResult = false;

            if (myBeam.Insert())
            {
                creationResult = myModel.CommitChanges();
            }
            return(creationResult);
        }
예제 #15
0
        private void FitBeam(TSM.Beam beam, double offset)
        {
            TSM.Fitting fitting = new TSM.Fitting();

            fitting.Father = beam;

            TSM.Plane fitPlane = new TSM.Plane();
            fitPlane.Origin = new TSG.Point(0, 0, offset);
            fitPlane.AxisX  = new TSG.Vector(1, 0, 0);
            fitPlane.AxisY  = new TSG.Vector(0, 1, 0);

            fitting.Plane = fitPlane;

            fitting.Insert();
        }
예제 #16
0
        private void btn_createbeam_Click(object sender, EventArgs e)
        {
            TSG.Point point1 = new TSG.Point(0, 0, 0);
            TSG.Point point2 = new TSG.Point(1000, 0, 0);

            TSM.Beam beam = new TSM.Beam();
            beam.StartPoint              = point1;
            beam.EndPoint                = point2;
            beam.Profile.ProfileString   = "H400X200X8X13";
            beam.Material.MaterialString = "C40";

            bool result = false;

            result = beam.Insert();
        }
예제 #17
0
        public void CreateBottomFlangePlate(TSG.Point Point1, TSG.Point Point2)
        {
            TSM.Beam myBeam = new TSM.Beam(new TSG.Point(Point1), new TSG.Point(Point2));
            myBeam.StartPoint.Y = myBeam.StartPoint.Y - this.webHeight / 2.0;
            myBeam.EndPoint.Y   = myBeam.EndPoint.Y - this.webHeight / 2.0;

            string profileString = "PL" + this.flangeThickness.ToString() + "*" + this.flangeWidth.ToString();

            myBeam.Profile.ProfileString = profileString.Replace(",", ".");
            myBeam.Finish            = "PAINT";
            myBeam.Position.Depth    = TSM.Position.DepthEnum.MIDDLE;
            myBeam.Position.Plane    = TSM.Position.PlaneEnum.LEFT;
            myBeam.Position.Rotation = TSM.Position.RotationEnum.TOP;
            myBeam.Insert();
        }
예제 #18
0
        // Top Plate
        private void CreateTopFlangePlate(TSG.Point Point1, TSG.Point Point2)
        {
            TSM.Beam myBeam = new TSM.Beam(new TSG.Point(Point1), new TSG.Point(Point2));
            myBeam.StartPoint.Y = myBeam.StartPoint.Y + this.WebHeight / 2.0;
            myBeam.EndPoint.Y   = myBeam.EndPoint.Y + this.WebHeight / 2.0;

            string profileString = "PL" + this.FlangeThickness.ToString() + "*" + this.FlangeWidth.ToString();

            myBeam.Profile.ProfileString = profileString.Replace(",", ".");

            myBeam.Finish            = "PAINT";
            myBeam.Position.Depth    = TSM.Position.DepthEnum.MIDDLE;
            myBeam.Position.Plane    = TSM.Position.PlaneEnum.RIGHT;
            myBeam.Position.Rotation = TSM.Position.RotationEnum.BELOW;
            myBeam.Insert();
        }
예제 #19
0
        public override List <InputDefinition> DefineInput()
        {
            MessageBox.Show("antes de instanciar un picker");

            Picker picker = new Picker();
            List <InputDefinition> inputList = new List <InputDefinition>();

            TSM.Beam muro = (TSM.Beam)picker.PickObject(Picker.PickObjectEnum.PICK_ONE_PART);

            InputDefinition input1 = new InputDefinition(muro.Identifier);

            inputList.Add(input1);

            MessageBox.Show("despues de capturar un muro");

            return(inputList);
        }
예제 #20
0
        private void btn_createColumn_Click(object sender, EventArgs e)
        {
            // Column 객체 생성
            // 왜 Beam타입으로 생성하는가? Tekla에서는 모든 직선객체는 Beam타입으로 생성한다.
            // 부재의 Profile 과 StartPoint, EndPoint를 지정하여 부재를 생성하는 방식.
            TSM.Beam column = new TSM.Beam();

            column.StartPoint              = new TSG.Point(0, 0, 0);    // column 생성 시작지점
            column.EndPoint                = new TSG.Point(0, 0, 3000); // column 생성 끝지점
            column.Profile.ProfileString   = "400*400";                 // column 규격
            column.Material.MaterialString = "C40";                     // column 재질
            column.Class = "1";                                         // column 클래스 (캐드의 Layer와 같은 개념)

            column.Insert();                                            // 현재 켜져있는 Tekla 모델에 column 삽입

            model.CommitChanges();                                      // model의 변경사항을 커밋
        }
예제 #21
0
        public static void DateLastMark(TSD.Drawing croquis, out string revisionMark, out int revisionDateSeconds)
        {
            Type         drawingType  = croquis.GetType();
            PropertyInfo propertyInfo = drawingType.GetProperty("Identifier", BindingFlags.Instance | BindingFlags.NonPublic);
            object       value        = propertyInfo.GetValue(croquis, null);

            Identifier identifier = (Identifier)value;

            TSM.Beam fakeBeam = new TSM.Beam {
                Identifier = identifier
            };

            revisionMark = "";
            fakeBeam.GetReportProperty("REVISION.LAST_MARK", ref revisionMark);

            revisionDateSeconds = 0;
            fakeBeam.GetReportProperty("REVISION.LAST_DATE_CREATE", ref revisionDateSeconds);
        }
예제 #22
0
        private static void swapHandlesChooser(TSM.Part part)
        {
            if (part is TSM.Beam)
            {
                TSM.Beam beam = part as TSM.Beam;
                SwapHandler.swapBeam(beam);
            }
            else if (part is TSM.PolyBeam)
            {
                TSM.PolyBeam polybeam = part as TSM.PolyBeam;
                SwapHandler.swapContour(polybeam);
            }
            else if (part is TSM.ContourPlate)
            {
                TSM.ContourPlate plate = part as TSM.ContourPlate;
                SwapHandler.swapContour(plate);
            }

            part.Modify();
        }
예제 #23
0
        public override bool checkModelObjects(_Mark other)
        {
            TSM.Beam part1 = _part as TSM.Beam;
            TSM.Beam part2 = other._part as TSM.Beam;

            T3D.Point p1start = __GeometryOperations.factor1Point(part1.StartPoint, _view as TSD.View);
            T3D.Point p1end   = __GeometryOperations.factor1Point(part1.EndPoint, _view as TSD.View);
            T3D.Point p2start = __GeometryOperations.factor1Point(part2.StartPoint, other._view as TSD.View);
            T3D.Point p2end   = __GeometryOperations.factor1Point(part2.EndPoint, other._view as TSD.View);

            if (!__GeometryOperations.compare2Points(p1start, p2start))
            {
                return(false);
            }
            if (!__GeometryOperations.compare2Points(p1end, p2end))
            {
                return(false);
            }

            return(true);
        }
예제 #24
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);
        }
예제 #25
0
        private static void newObject(string fromModelCUP, double fromModelCOG_X, double fromModelCOG_Y, double fromModelCOG_Z)
        {
            TSM.Beam newObject = new TSM.Beam();

            newObject.Name = "COG for: " + fromModelCUP;
            newObject.Profile.ProfileString   = "D100";
            newObject.Material.MaterialString = "Z35";
            newObject.Class                 = "1000";
            newObject.PartNumber.Prefix     = "cg";
            newObject.AssemblyNumber.Prefix = "CG";
            newObject.StartPoint.X          = fromModelCOG_X;
            newObject.StartPoint.Y          = fromModelCOG_Y;
            newObject.StartPoint.Z          = fromModelCOG_Z;
            newObject.EndPoint.X            = fromModelCOG_X + 10000;
            newObject.EndPoint.Y            = fromModelCOG_Y;
            newObject.EndPoint.Z            = fromModelCOG_Z;
            newObject.Position.Rotation     = Position.RotationEnum.TOP;
            newObject.Position.Plane        = Position.PlaneEnum.MIDDLE;
            newObject.Position.Depth        = Position.DepthEnum.MIDDLE;

            newObject.Insert();
        }
예제 #26
0
        public override bool Run(List <InputDefinition> Input)
        {
            try
            {
                double Height = _data.height;

                TSG.Point StartPoint = (TSG.Point)Input[0].GetInput();

                TSG.Point EndPoint = new TSG.Point(StartPoint);
                EndPoint.Z += Height;

                TSM.Beam Column = new TSM.Beam(StartPoint, EndPoint);
                Column.Profile.ProfileString = "HEA400";

                Column.Insert();

                _model.CommitChanges();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            return(true);
        }
예제 #27
0
        static private double findMinimum(TSM.Part current)
        {
            double min = Double.MaxValue;

            if (current is TSM.ContourPlate)
            {
                TSM.ContourPlate currentCP = current as TSM.ContourPlate;

                foreach (Point cur in currentCP.Contour.ContourPoints)
                {
                    if (min > cur.Z)
                    {
                        min = cur.Z;
                    }
                }
            }
            else if (current is TSM.Beam)
            {
                TSM.Beam currentBeam = current as TSM.Beam;
                min = Math.Min(currentBeam.StartPoint.Z, currentBeam.EndPoint.Z);
            }

            return(min);
        }
예제 #28
0
            public void Modify(PropertyValueChangedEventArgs e)
            {
                string label = e.ChangedItem.Label;
                ModelObjectEnumerator modelObjectEnum = model.GetModelObjectSelector().GetSelectedObjects();

                while (modelObjectEnum.MoveNext())
                {
                    if (modelObjectEnum.Current is Tekla.Structures.Model.Beam)
                    {
                        Tekla.Structures.Model.Beam beam = (Tekla.Structures.Model.Beam)modelObjectEnum.Current;
                        if (label == "Name")
                        {
                            beam.Name = name;
                        }
                        if (label == "Profile")
                        {
                            beam.Profile.ProfileString = profile;
                        }
                        if (label == "Material")
                        {
                            beam.Material.MaterialString = material;
                        }
                        if (label == "Finish")
                        {
                            beam.Finish = finish;
                        }
                        if (label == "Class")
                        {
                            beam.Class = classValue;
                        }
                        if (label == "PartPrefix")
                        {
                            beam.PartNumber.Prefix = partPrefix;
                        }
                        if (label == "PartStartNo")
                        {
                            beam.PartNumber.StartNumber = int.Parse(partStartNo);
                        }
                        if (label == "AssemblyPrefix")
                        {
                            beam.AssemblyNumber.Prefix = assemblyPrefix;
                        }
                        if (label == "AssemblyStartNo")
                        {
                            beam.AssemblyNumber.StartNumber = int.Parse(assemblyStartNo);
                        }
                        if (label == "Phase")
                        {
                            beam.SetPhase(new Phase(int.Parse(phase)));
                        }
                        if (label == "OffsetStartPointX")
                        {
                            beam.StartPointOffset.Dx = double.Parse(offsetStartPointX);
                        }
                        if (label == "OffsetStartPointY")
                        {
                            beam.StartPointOffset.Dy = double.Parse(offsetStartPointY);
                        }
                        if (label == "OffsetStartPointZ")
                        {
                            beam.StartPointOffset.Dz = double.Parse(offsetStartPointZ);
                        }
                        if (label == "OffsetEndPointX")
                        {
                            beam.EndPointOffset.Dx = double.Parse(offsetEndPointX);
                        }
                        if (label == "OffsetEndPointY")
                        {
                            beam.EndPointOffset.Dy = double.Parse(offsetEndPointY);
                        }
                        if (label == "OffsetEndPointZ")
                        {
                            beam.EndPointOffset.Dz = double.Parse(offsetEndPointZ);
                        }
                        if (label == "ZStart")
                        {
                            beam.StartPoint.Z = double.Parse(zStart);
                        }
                        if (label == "ZEnd")
                        {
                            beam.EndPoint.Z = double.Parse(zEnd);
                        }
                        if (label == "PositionOnPlane")
                        {
                            if (positionOnPlane == PositionPlaneEnum.Left)
                            {
                                beam.Position.Plane = Position.PlaneEnum.LEFT;
                            }
                            if (positionOnPlane == PositionPlaneEnum.Middle)
                            {
                                beam.Position.Plane = Position.PlaneEnum.MIDDLE;
                            }
                            if (positionOnPlane == PositionPlaneEnum.Right)
                            {
                                beam.Position.Plane = Position.PlaneEnum.RIGHT;
                            }
                        }

                        if (label == "PositionOnPlaneOffset")
                        {
                            beam.Position.PlaneOffset = double.Parse(positionOnPlaneOffset);
                        }

                        if (label == "PositionRotation")
                        {
                            if (positionRotation == PositionRotationEnum.Top)
                            {
                                beam.Position.Rotation = Position.RotationEnum.TOP;
                            }
                            if (positionRotation == PositionRotationEnum.Front)
                            {
                                beam.Position.Rotation = Position.RotationEnum.FRONT;
                            }
                            if (positionRotation == PositionRotationEnum.Back)
                            {
                                beam.Position.Rotation = Position.RotationEnum.BACK;
                            }
                            if (positionRotation == PositionRotationEnum.Below)
                            {
                                beam.Position.Rotation = Position.RotationEnum.BELOW;
                            }
                        }

                        if (label == "PositionRotationOffset")
                        {
                            beam.Position.RotationOffset = double.Parse(positionRotationOffset);
                        }

                        if (label == "PositionAtDepth")
                        {
                            if (positionAtDepth == PositionDepthEnum.Behind)
                            {
                                beam.Position.Depth = Position.DepthEnum.BEHIND;
                            }
                            if (positionAtDepth == PositionDepthEnum.Front)
                            {
                                beam.Position.Depth = Position.DepthEnum.FRONT;
                            }
                            if (positionAtDepth == PositionDepthEnum.Middle)
                            {
                                beam.Position.Depth = Position.DepthEnum.MIDDLE;
                            }
                        }

                        if (label == "PositionAtDepthOffset")
                        {
                            beam.Position.DepthOffset = double.Parse(positionAtDepthOffset);
                        }
                        if (label == "Userfield1")
                        {
                            beam.SetUserProperty("USER_FIELD_1", userfield1);
                        }
                        if (label == "Userfield2")
                        {
                            beam.SetUserProperty("USER_FIELD_2", userfield2);
                        }
                        if (label == "Userfield3")
                        {
                            beam.SetUserProperty("USER_FIELD_3", userfield3);
                        }
                        if (label == "Userfield4")
                        {
                            beam.SetUserProperty("USER_FIELD_4", userfield4);
                        }
                        if (label == "NotesComments")
                        {
                            beam.SetUserProperty("comment", notesComments);
                        }
                        if (label == "FittingNotes")
                        {
                            beam.SetUserProperty("FIT_NOTES", fittingNotes);
                        }
                        if (label == "FittingNotes2")
                        {
                            beam.SetUserProperty("FIT_NOTES2", fittingNotes2);
                        }
                        if (label == "Cambering")
                        {
                            beam.SetUserProperty("cambering", cambering);
                        }
                        if (label == "Paint")
                        {
                            beam.SetUserProperty("PAINT", paint);
                        }
                        if (label == "PreliminaryMark")
                        {
                            beam.SetUserProperty("PRELIM_MARK", preliminaryMark);
                        }
                        if (label == "PaintWFT")
                        {
                            beam.SetUserProperty("PAINT_WFT", paintWFT);
                        }
                        if (label == "PaintDFT")
                        {
                            beam.SetUserProperty("PAINT_DFT", paintDFT);
                        }
                        if (label == "ShearStart")
                        {
                            beam.SetUserProperty("shear1", double.Parse(shearStart) * 1000);
                        }
                        if (label == "ShearEnd")
                        {
                            beam.SetUserProperty("shear2", double.Parse(shearEnd) * 1000);
                        }
                        if (label == "AxialStart")
                        {
                            beam.SetUserProperty("axial1", double.Parse(axialStart) * 1000);
                        }
                        if (label == "AxialEnd")
                        {
                            beam.SetUserProperty("axial2", double.Parse(axialEnd) * 1000);
                        }
                        if (label == "MomentStart")
                        {
                            beam.SetUserProperty("moment1", double.Parse(momentStart) * 1000);
                        }
                        if (label == "MomentEnd")
                        {
                            beam.SetUserProperty("moment2", double.Parse(momentEnd) * 1000);
                        }
                        if (label == "ConnCodeStart")
                        {
                            beam.SetUserProperty("CONN_CODE_END1", connCodeStart);
                        }
                        if (label == "ConnCodeEnd")
                        {
                            beam.SetUserProperty("CONN_CODE_END2", connCodeEnd);
                        }

                        beam.Modify();
                    }
                }
            }
예제 #29
0
            public void GetProperties()
            {
                ModelObjectEnumerator modelObjectEnum = model.GetModelObjectSelector().GetSelectedObjects();

                if (modelObjectEnum.GetSize() == 1)
                {
                    while (modelObjectEnum.MoveNext())
                    {
                        if (modelObjectEnum.Current is Tekla.Structures.Model.Beam)
                        {
                            Tekla.Structures.Model.Beam beam = (Tekla.Structures.Model.Beam)modelObjectEnum.Current;

                            TransformationPlane currentTP = new TransformationPlane();
                            currentTP = model.GetWorkPlaneHandler().GetCurrentTransformationPlane();

                            model.GetWorkPlaneHandler().SetCurrentTransformationPlane(new TransformationPlane());

                            beam.Select();

                            Assembly assembly = beam.GetAssembly() as Tekla.Structures.Model.Assembly;
                            assembly.GetReportProperty("ASSEMBLY_POSITION_CODE", ref gridLocation);
                            partType = beam.GetType().Name;
                            partID   = beam.Identifier.ID.ToString();
                            beam.GetReportProperty("OWNER", ref owner);
                            zStart          = beam.StartPoint.Z.ToString("F02");
                            zEnd            = beam.EndPoint.Z.ToString("F02");
                            partPrefix      = beam.PartNumber.Prefix;
                            partStartNo     = beam.PartNumber.StartNumber.ToString();
                            assemblyPrefix  = beam.AssemblyNumber.Prefix;
                            assemblyStartNo = beam.AssemblyNumber.StartNumber.ToString();
                            Phase CurrentPhase = new Phase();
                            beam.GetPhase(out CurrentPhase);
                            phase      = CurrentPhase.PhaseNumber.ToString();
                            name       = beam.Name;
                            profile    = beam.Profile.ProfileString;
                            material   = beam.Material.MaterialString;
                            finish     = beam.Finish;
                            classValue = beam.Class;
                            if (beam.Position.Plane == Position.PlaneEnum.LEFT)
                            {
                                positionOnPlane = PositionPlaneEnum.Left;
                            }
                            else if (beam.Position.Plane == Position.PlaneEnum.MIDDLE)
                            {
                                positionOnPlane = PositionPlaneEnum.Middle;
                            }
                            else if (beam.Position.Plane == Position.PlaneEnum.RIGHT)
                            {
                                positionOnPlane = PositionPlaneEnum.Right;
                            }
                            positionOnPlaneOffset = beam.Position.PlaneOffset.ToString("F02");
                            if (beam.Position.Rotation == Position.RotationEnum.BACK)
                            {
                                positionRotation = PositionRotationEnum.Back;
                            }
                            else if (beam.Position.Rotation == Position.RotationEnum.BELOW)
                            {
                                positionRotation = PositionRotationEnum.Below;
                            }
                            else if (beam.Position.Rotation == Position.RotationEnum.FRONT)
                            {
                                positionRotation = PositionRotationEnum.Front;
                            }
                            else if (beam.Position.Rotation == Position.RotationEnum.TOP)
                            {
                                positionRotation = PositionRotationEnum.Top;
                            }
                            positionRotationOffset = beam.Position.RotationOffset.ToString("F02");
                            if (beam.Position.Depth == Position.DepthEnum.BEHIND)
                            {
                                positionAtDepth = PositionDepthEnum.Behind;
                            }
                            else if (beam.Position.Depth == Position.DepthEnum.FRONT)
                            {
                                positionAtDepth = PositionDepthEnum.Front;
                            }
                            else if (beam.Position.Depth == Position.DepthEnum.MIDDLE)
                            {
                                positionAtDepth = PositionDepthEnum.Middle;
                            }
                            positionAtDepthOffset = beam.Position.DepthOffset.ToString("F02");
                            offsetStartPointX     = beam.StartPointOffset.Dx.ToString("F02");
                            offsetStartPointY     = beam.StartPointOffset.Dy.ToString("F02");
                            offsetStartPointZ     = beam.StartPointOffset.Dz.ToString("F02");
                            offsetEndPointX       = beam.EndPointOffset.Dx.ToString("F02");
                            offsetEndPointY       = beam.EndPointOffset.Dy.ToString("F02");
                            offsetEndPointZ       = beam.EndPointOffset.Dz.ToString("F02");
                            beam.GetUserProperty("USER_FIELD_1", ref userfield1);
                            beam.GetUserProperty("USER_FIELD_2", ref userfield2);
                            beam.GetUserProperty("USER_FIELD_3", ref userfield3);
                            beam.GetUserProperty("USER_FIELD_4", ref userfield4);
                            beam.GetUserProperty("comment", ref notesComments);
                            beam.GetUserProperty("FIT_NOTES", ref fittingNotes);
                            beam.GetUserProperty("FIT_NOTES2", ref fittingNotes2);
                            beam.GetUserProperty("cambering", ref cambering);
                            beam.GetUserProperty("PAINT", ref paint);
                            beam.GetUserProperty("PRELIM_MARK", ref preliminaryMark);
                            beam.GetUserProperty("PAINT_WFT", ref paintWFT);
                            beam.GetUserProperty("PAINT_DFT", ref paintDFT);
                            double dblshear1  = 0; beam.GetUserProperty("shear1", ref dblshear1); dblshear1 = dblshear1 * 0.001; shearStart = dblshear1.ToString();
                            double dblshear2  = 0; beam.GetUserProperty("shear2", ref dblshear2); dblshear2 = dblshear2 * 0.001; shearEnd = dblshear2.ToString();
                            double dblaxial1  = 0; beam.GetUserProperty("axial1", ref dblaxial1); dblaxial1 = dblaxial1 * 0.001; axialStart = dblaxial1.ToString();
                            double dblaxial2  = 0; beam.GetUserProperty("axial2", ref dblaxial2); dblaxial2 = dblaxial2 * 0.001; axialEnd = dblaxial2.ToString();
                            double dblmoment1 = 0; beam.GetUserProperty("moment1", ref dblmoment1); dblmoment1 = dblmoment1 * 0.001; momentStart = dblmoment1.ToString();
                            double dblmoment2 = 0; beam.GetUserProperty("moment2", ref dblmoment2); dblmoment2 = dblmoment2 * 0.001; momentEnd = dblmoment2.ToString();

                            beam.GetUserProperty("CONN_CODE_END1", ref connCodeStart);
                            beam.GetUserProperty("CONN_CODE_END2", ref connCodeEnd);
                            model.GetWorkPlaneHandler().SetCurrentTransformationPlane(currentTP);
                        }
                    }
                }
                if (modelObjectEnum.GetSize() > 1)
                {
                    partType               = "";
                    partID                 = "";
                    owner                  = "";
                    gridLocation           = "";
                    partPrefix             = "";
                    partStartNo            = "";
                    assemblyPrefix         = "";
                    assemblyStartNo        = "";
                    phase                  = "";
                    name                   = "";
                    profile                = "";
                    material               = "";
                    finish                 = "";
                    classValue             = "";
                    userfield1             = "";
                    userfield2             = "";
                    userfield3             = "";
                    userfield4             = "";
                    notesComments          = "";
                    fittingNotes           = "";
                    fittingNotes2          = "";
                    cambering              = "";
                    paint                  = "";
                    preliminaryMark        = "";
                    paintWFT               = "";
                    paintDFT               = "";
                    shearStart             = "";
                    shearEnd               = "";
                    axialStart             = "";
                    axialEnd               = "";
                    momentStart            = "";
                    momentEnd              = "";
                    connCodeStart          = "";
                    connCodeEnd            = "";
                    positionOnPlane        = new PositionPlaneEnum();
                    positionOnPlaneOffset  = "";
                    positionRotation       = new PositionRotationEnum();
                    positionRotationOffset = "";
                    positionAtDepth        = new PositionDepthEnum();
                    positionAtDepthOffset  = "";
                    offsetStartPointX      = "";
                    offsetStartPointY      = "";
                    offsetStartPointZ      = "";
                    offsetEndPointX        = "";
                    offsetEndPointY        = "";
                    offsetEndPointZ        = "";
                    zStart                 = "";
                    zEnd                   = "";
                }
            }
예제 #30
-1
        private void markHandler(TSD.Mark currentMark)
        {
            if (currentMark.Attributes.Content.Count > 0)
            {
                System.Type[] Types = new System.Type[1];
                Types.SetValue(typeof(TSD.ModelObject), 0);
                TSD.DrawingObjectEnumerator markObjects = currentMark.GetRelatedObjects(Types);

                foreach (TSD.ModelObject currentDO in markObjects)
                {
                    TSM.Model       myModel     = new TSM.Model();
                    TSM.ModelObject modelObject = myModel.SelectModelObject(currentDO.ModelIdentifier);

                    if (modelObject != null)
                    {
                        if (modelObject is TSM.Beam)
                        {
                            TSM.Beam currentMO = modelObject as TSM.Beam;
                            markBeams.Add(new _Mark_Beam(currentMark, currentMO, currentDO, this.view));
                        }
                        else if (modelObject is TSM.PolyBeam)
                        {
                            TSM.PolyBeam currentMO = modelObject as TSM.PolyBeam;
                            markPolyBeams.Add(new _Mark_PolyBeam(currentMark, currentMO, currentDO, this.view));
                        }
                        else if (modelObject is TSM.ContourPlate)
                        {
                            TSM.ContourPlate currentMO = modelObject as TSM.ContourPlate;
                            markContourPlates.Add(new _Mark_ContourPlate(currentMark, currentMO, currentDO, this.view));
                        }
                        else if (modelObject is TSM.SingleRebar)
                        {
                            TSM.SingleRebar currentMO = modelObject as TSM.SingleRebar;
                            markSingleRebars.Add(new _Mark_SingleRebar(currentMark, currentMO, currentDO, this.view));
                        }
                        else if (modelObject is TSM.RebarGroup)
                        {
                            TSM.BaseRebarGroup currentMO = modelObject as TSM.RebarGroup;
                            markRebarBases.Add(new _Mark_RebarGroup(currentMark, currentMO, currentDO, this.view));
                        }
                        else if (modelObject is TSM.BoltGroup)
                        {
                            TSM.BoltGroup currentMO = modelObject as TSM.BoltGroup;
                            markBoltGroup.Add(new _Mark_BoltGroup(currentMark, currentMO, currentDO, this.view));
                        }
                    }
                }
            }
        }