static private OpenModel CreateConnectionGeometry(OpenModel openModel)
        {
            //Add connection point
            IdeaRS.OpenModel.Connection.ConnectionPoint connection = new IdeaRS.OpenModel.Connection.ConnectionPoint();

            IdeaRS.OpenModel.Geometry3D.Point3D point = new IdeaRS.OpenModel.Geometry3D.Point3D()
            {
                X = -2, Y = 3, Z = 3
            };
            point.Id   = openModel.GetMaxId(point) + 1;
            point.Name = point.Id.ToString();
            openModel.Point3D.Add(point);

            connection.Node = new ReferenceElement(point);
            connection.Name = point.Name;
            connection.Id   = openModel.GetMaxId(connection) + 1;

            //add connection
            openModel.Connections.Add(new IdeaRS.OpenModel.Connection.ConnectionData());

            //add Beams
            openModel.Connections[0].Beams = new List <IdeaRS.OpenModel.Connection.BeamData>();

            //member1D 1
            IdeaRS.OpenModel.Connection.BeamData beam1Data = new IdeaRS.OpenModel.Connection.BeamData
            {
                Name                     = "M1",
                Id                       = 1,
                OriginalModelId          = "1",
                IsAdded                  = false,
                MirrorY                  = false,
                RefLineInCenterOfGravity = false,
            };
            openModel.Connections[0].Beams.Add(beam1Data);

            var member1 = openModel.Member1D.Find(x => x.Id == 1);

            IdeaRS.OpenModel.Connection.ConnectedMember conMb = new IdeaRS.OpenModel.Connection.ConnectedMember
            {
                Id           = member1.Id,
                MemberId     = new ReferenceElement(member1),
                IsContinuous = false,
            };
            connection.ConnectedMembers.Add(conMb);

            //member1D 3
            var member3 = openModel.Member1D.Find(x => x.Id == 3);

            IdeaRS.OpenModel.Connection.ConnectedMember conMb3 = new IdeaRS.OpenModel.Connection.ConnectedMember
            {
                Id           = member3.Id,
                MemberId     = new ReferenceElement(member3),
                IsContinuous = true,
            };
            connection.ConnectedMembers.Add(conMb3);

            IdeaRS.OpenModel.Connection.BeamData beam2Data = new IdeaRS.OpenModel.Connection.BeamData
            {
                Name                     = "M3",
                Id                       = 3,
                OriginalModelId          = member3.Id.ToString(),
                IsAdded                  = false,
                MirrorY                  = false,
                RefLineInCenterOfGravity = false,
            };
            openModel.Connections[0].Beams.Add(beam2Data);

            openModel.AddObject(connection);

            //add plate
            IdeaRS.OpenModel.Connection.PlateData plateData = new IdeaRS.OpenModel.Connection.PlateData
            {
                Name            = "P1",
                Thickness       = 0.02,
                Id              = 11,
                Material        = "S355",
                OriginalModelId = "11",
                Origin          = new IdeaRS.OpenModel.Geometry3D.Point3D
                {
                    X = -1.87,
                    Y = 2.88,
                    Z = 2.7
                },
                AxisX = new IdeaRS.OpenModel.Geometry3D.Vector3D
                {
                    X = 0,
                    Y = 1,
                    Z = 0
                },
                AxisY = new IdeaRS.OpenModel.Geometry3D.Vector3D
                {
                    X = 0,
                    Y = 0,
                    Z = 1
                },
                AxisZ = new IdeaRS.OpenModel.Geometry3D.Vector3D
                {
                    X = 1,
                    Y = 0,
                    Z = 0
                },
                Region = "M 0 0 L 0.24 0 L 0.24 0.5 L 0 0.5 L 0 0",
            };

            (openModel.Connections[0].Plates ?? (openModel.Connections[0].Plates = new List <IdeaRS.OpenModel.Connection.PlateData>())).Add(plateData);

            // add cut
            openModel.Connections[0].CutBeamByBeams = new List <IdeaRS.OpenModel.Connection.CutBeamByBeamData>
            {
                new IdeaRS.OpenModel.Connection.CutBeamByBeamData
                {
                    CuttingObject  = new ReferenceElement(plateData),
                    ModifiedObject = new ReferenceElement(beam1Data),
                    Orientation    = CutOrientation.Parallel,
                    WeldType       = WeldType.DoubleFillet,
                    IsWeld         = true,
                }
            };

            IdeaRS.OpenModel.Connection.BoltGrid boltGrid = new IdeaRS.OpenModel.Connection.BoltGrid()
            {
                Id = 41,
                ConnectedPartIds     = new List <string>(),
                Diameter             = 0.016,
                HeadDiameter         = 0.024,
                DiagonalHeadDiameter = 0.026,
                HeadHeight           = 0.01,
                BoreHole             = 0.018,
                TensileStressArea    = 157,
                NutThickness         = 0.013,
                AnchorLen            = 0.05,
                Material             = "8.8",
                Standard             = "M 16",
            };

            boltGrid.Origin = new IdeaRS.OpenModel.Geometry3D.Point3D()
            {
                X = plateData.Origin.X, Y = plateData.Origin.Y, Z = plateData.Origin.Z
            };
            boltGrid.AxisX = new IdeaRS.OpenModel.Geometry3D.Vector3D()
            {
                X = plateData.AxisX.X, Y = plateData.AxisX.Y, Z = plateData.AxisX.Z
            };
            boltGrid.AxisY = new IdeaRS.OpenModel.Geometry3D.Vector3D()
            {
                X = plateData.AxisY.X, Y = plateData.AxisY.Y, Z = plateData.AxisY.Z
            };
            boltGrid.AxisZ = new IdeaRS.OpenModel.Geometry3D.Vector3D()
            {
                X = plateData.AxisZ.X, Y = plateData.AxisZ.Y, Z = plateData.AxisZ.Z
            };
            boltGrid.Positions = new List <IdeaRS.OpenModel.Geometry3D.Point3D>
            {
                new IdeaRS.OpenModel.Geometry3D.Point3D()
                {
                    X = -1.87,
                    Y = 2.92,
                    Z = 2.8
                },
                new IdeaRS.OpenModel.Geometry3D.Point3D()
                {
                    X = -1.87,
                    Y = 3.08,
                    Z = 2.8
                },
                new IdeaRS.OpenModel.Geometry3D.Point3D()
                {
                    X = -1.87,
                    Y = 2.92,
                    Z = 3.15
                },
                new IdeaRS.OpenModel.Geometry3D.Point3D()
                {
                    X = -1.87,
                    Y = 3.08,
                    Z = 3.15
                }
            };

            boltGrid.ConnectedPartIds = new List <string>()
            {
                beam2Data.OriginalModelId, plateData.OriginalModelId
            };

            (openModel.Connections[0].BoltGrids ?? (openModel.Connections[0].BoltGrids = new List <IdeaRS.OpenModel.Connection.BoltGrid>())).Add(boltGrid);

            //add plate 2
            IdeaRS.OpenModel.Connection.PlateData plateData2 = new IdeaRS.OpenModel.Connection.PlateData
            {
                Name            = "P2",
                Thickness       = 0.02,
                Id              = 12,
                Material        = "S355",
                OriginalModelId = "12",
                Origin          = new IdeaRS.OpenModel.Geometry3D.Point3D
                {
                    X = -2.103,
                    Y = 2.88,
                    Z = 2.75
                },
                AxisX = new IdeaRS.OpenModel.Geometry3D.Vector3D
                {
                    X = 1,
                    Y = 0,
                    Z = 0
                },
                AxisY = new IdeaRS.OpenModel.Geometry3D.Vector3D
                {
                    X = 0,
                    Y = 1,
                    Z = 0
                },
                AxisZ = new IdeaRS.OpenModel.Geometry3D.Vector3D
                {
                    X = 0,
                    Y = 0,
                    Z = 1
                },
                Region = "M 0 0 L 0.206 0 L 0.206 0.105 L 0.195 0.115 L 0.011 0.115 L 0.0 0.105 L 0 0",
            };

            (openModel.Connections[0].Plates ?? (openModel.Connections[0].Plates = new List <IdeaRS.OpenModel.Connection.PlateData>())).Add(plateData2);
            //add weld between memeber 2 and plate 2 - stiffener
            IdeaRS.OpenModel.Connection.WeldData weldData = new IdeaRS.OpenModel.Connection.WeldData()
            {
                Id = 31,
                ConnectedPartIds = new List <string>()
                {
                    plateData2.OriginalModelId, beam2Data.OriginalModelId
                },
                Start = new IdeaRS.OpenModel.Geometry3D.Point3D()
                {
                    X = -2,
                    Y = 2.995,
                    Z = 2.76
                },
                End = new IdeaRS.OpenModel.Geometry3D.Point3D()
                {
                    X = -2,
                    Y = 2.995,
                    Z = 2.76
                },
                Thickness = 0.004,
                WeldType  = IdeaRS.OpenModel.Connection.WeldType.DoubleFillet,
            };
            (openModel.Connections[0].Welds ?? (openModel.Connections[0].Welds = new List <IdeaRS.OpenModel.Connection.WeldData>())).Add(weldData);

            //add weld3 between memeber 2 and plate 2 - stiffener
            IdeaRS.OpenModel.Connection.WeldData weldData3 = new IdeaRS.OpenModel.Connection.WeldData()
            {
                Id = 33,
                ConnectedPartIds = new List <string>()
                {
                    plateData2.OriginalModelId, beam2Data.OriginalModelId
                },
                Start = new IdeaRS.OpenModel.Geometry3D.Point3D()
                {
                    X = -2.103,
                    Y = 2.90,
                    Z = 2.76
                },
                End = new IdeaRS.OpenModel.Geometry3D.Point3D()
                {
                    X = -2.103,
                    Y = 2.90,
                    Z = 2.76
                },
                Thickness = 0.004,
                WeldType  = IdeaRS.OpenModel.Connection.WeldType.DoubleFillet,
            };
            openModel.Connections[0].Welds.Add(weldData3);

            //add weld4 between memeber 2 and plate 2 - stiffener
            IdeaRS.OpenModel.Connection.WeldData weldData4 = new IdeaRS.OpenModel.Connection.WeldData()
            {
                Id = 34,
                ConnectedPartIds = new List <string>()
                {
                    plateData2.OriginalModelId, beam2Data.OriginalModelId
                },
                Start = new IdeaRS.OpenModel.Geometry3D.Point3D()
                {
                    X = -1.897,
                    Y = 2.90,
                    Z = 2.76
                },
                End = new IdeaRS.OpenModel.Geometry3D.Point3D()
                {
                    X = -1.897,
                    Y = 2.90,
                    Z = 2.76
                },
                Thickness = 0.004,
                WeldType  = IdeaRS.OpenModel.Connection.WeldType.DoubleFillet,
            };
            openModel.Connections[0].Welds.Add(weldData4);

            //add plate 3
            IdeaRS.OpenModel.Connection.PlateData plateData3 = new IdeaRS.OpenModel.Connection.PlateData
            {
                Name            = "P3",
                Thickness       = 0.02,
                Id              = 13,
                Material        = "S355",
                OriginalModelId = "13",
                Origin          = new IdeaRS.OpenModel.Geometry3D.Point3D
                {
                    X = -2.103,
                    Y = 2.88,
                    Z = 3.1
                },
                AxisX = new IdeaRS.OpenModel.Geometry3D.Vector3D
                {
                    X = 1,
                    Y = 0,
                    Z = 0
                },
                AxisY = new IdeaRS.OpenModel.Geometry3D.Vector3D
                {
                    X = 0,
                    Y = 1,
                    Z = 0
                },
                AxisZ = new IdeaRS.OpenModel.Geometry3D.Vector3D
                {
                    X = 0,
                    Y = 0,
                    Z = 1
                },
                Region = "M 0 0 L 0.206 0 L 0.206 0.105 L 0.195 0.115 L 0.011 0.115 L 0.0 0.105 L 0 0",
            };
            openModel.Connections[0].Plates.Add(plateData3);

            //add weld between memeber 2 and plate 3 - stiffener
            IdeaRS.OpenModel.Connection.WeldData weldData2 = new IdeaRS.OpenModel.Connection.WeldData()
            {
                Id = 32,
                ConnectedPartIds = new List <string>()
                {
                    plateData3.OriginalModelId, beam2Data.OriginalModelId
                },
                Start = new IdeaRS.OpenModel.Geometry3D.Point3D()
                {
                    X = -2,
                    Y = 2.995,
                    Z = 3.11
                },
                End = new IdeaRS.OpenModel.Geometry3D.Point3D()
                {
                    X = -2,
                    Y = 2.995,
                    Z = 3.11
                },
                Thickness = 0.004,
                WeldType  = IdeaRS.OpenModel.Connection.WeldType.DoubleFillet,
            };
            openModel.Connections[0].Welds.Add(weldData2);

            //add weld5 between memeber 2 and plate 3 - stiffener
            IdeaRS.OpenModel.Connection.WeldData weldData5 = new IdeaRS.OpenModel.Connection.WeldData()
            {
                Id = 35,
                ConnectedPartIds = new List <string>()
                {
                    plateData3.OriginalModelId, beam2Data.OriginalModelId
                },
                Start = new IdeaRS.OpenModel.Geometry3D.Point3D()
                {
                    X = -2.103,
                    Y = 2.90,
                    Z = 3.11
                },
                End = new IdeaRS.OpenModel.Geometry3D.Point3D()
                {
                    X = -2.103,
                    Y = 2.90,
                    Z = 3.11
                },
                Thickness = 0.004,
                WeldType  = IdeaRS.OpenModel.Connection.WeldType.DoubleFillet,
            };
            openModel.Connections[0].Welds.Add(weldData5);

            //add weld6 between memeber 2 and plate 3 - stiffener
            IdeaRS.OpenModel.Connection.WeldData weldData6 = new IdeaRS.OpenModel.Connection.WeldData()
            {
                Id = 36,
                ConnectedPartIds = new List <string>()
                {
                    plateData3.OriginalModelId, beam2Data.OriginalModelId
                },
                Start = new IdeaRS.OpenModel.Geometry3D.Point3D()
                {
                    X = -1.897,
                    Y = 2.90,
                    Z = 3.11
                },
                End = new IdeaRS.OpenModel.Geometry3D.Point3D()
                {
                    X = -1.897,
                    Y = 2.90,
                    Z = 3.11
                },
                Thickness = 0.004,
                WeldType  = IdeaRS.OpenModel.Connection.WeldType.DoubleFillet,
            };
            openModel.Connections[0].Welds.Add(weldData6);

            //add plate 4
            IdeaRS.OpenModel.Connection.PlateData plateData4 = new IdeaRS.OpenModel.Connection.PlateData
            {
                Name            = "P4",
                Thickness       = 0.02,
                Id              = 14,
                Material        = "S355",
                OriginalModelId = "14",
                Origin          = new IdeaRS.OpenModel.Geometry3D.Point3D
                {
                    X = -2.103,
                    Y = 3.12,
                    Z = 2.75
                },
                AxisX = new IdeaRS.OpenModel.Geometry3D.Vector3D
                {
                    X = 1,
                    Y = 0,
                    Z = 0
                },
                AxisY = new IdeaRS.OpenModel.Geometry3D.Vector3D
                {
                    X = 0,
                    Y = -1,
                    Z = 0
                },
                AxisZ = new IdeaRS.OpenModel.Geometry3D.Vector3D
                {
                    X = 0,
                    Y = 0,
                    Z = 1
                },
                Region = "M 0 0 L 0.206 0 L 0.206 0.105 L 0.195 0.115 L 0.011 0.115 L 0.0 0.105 L 0 0",
            };
            openModel.Connections[0].Plates.Add(plateData4);

            //add weld7 between memeber 2 and plate 4 - stiffener
            IdeaRS.OpenModel.Connection.WeldData weldData7 = new IdeaRS.OpenModel.Connection.WeldData()
            {
                Id = 37,
                ConnectedPartIds = new List <string>()
                {
                    plateData4.OriginalModelId, beam2Data.OriginalModelId
                },
                Start = new IdeaRS.OpenModel.Geometry3D.Point3D()
                {
                    X = -2,
                    Y = 3.005,
                    Z = 2.76
                },
                End = new IdeaRS.OpenModel.Geometry3D.Point3D()
                {
                    X = -2,
                    Y = 3.005,
                    Z = 2.76
                },
                Thickness = 0.004,
                WeldType  = IdeaRS.OpenModel.Connection.WeldType.DoubleFillet,
            };
            openModel.Connections[0].Welds.Add(weldData7);

            //add weld8 between memeber 2 and plate 4 - stiffener
            IdeaRS.OpenModel.Connection.WeldData weldData8 = new IdeaRS.OpenModel.Connection.WeldData()
            {
                Id = 38,
                ConnectedPartIds = new List <string>()
                {
                    plateData4.OriginalModelId, beam2Data.OriginalModelId
                },
                Start = new IdeaRS.OpenModel.Geometry3D.Point3D()
                {
                    X = -2.103,
                    Y = 3.1,
                    Z = 2.76
                },
                End = new IdeaRS.OpenModel.Geometry3D.Point3D()
                {
                    X = -2.103,
                    Y = 3.1,
                    Z = 2.76
                },
                Thickness = 0.004,
                WeldType  = IdeaRS.OpenModel.Connection.WeldType.DoubleFillet,
            };
            openModel.Connections[0].Welds.Add(weldData8);

            //add weld9 between memeber 2 and plate 4 - stiffener
            IdeaRS.OpenModel.Connection.WeldData weldData9 = new IdeaRS.OpenModel.Connection.WeldData()
            {
                Id = 39,
                ConnectedPartIds = new List <string>()
                {
                    plateData4.OriginalModelId, beam2Data.OriginalModelId
                },
                Start = new IdeaRS.OpenModel.Geometry3D.Point3D()
                {
                    X = -1.897,
                    Y = 3.1,
                    Z = 2.76
                },
                End = new IdeaRS.OpenModel.Geometry3D.Point3D()
                {
                    X = -1.897,
                    Y = 3.1,
                    Z = 2.76
                },
                Thickness = 0.004,
                WeldType  = IdeaRS.OpenModel.Connection.WeldType.DoubleFillet,
            };
            openModel.Connections[0].Welds.Add(weldData9);

            //add plate 5
            IdeaRS.OpenModel.Connection.PlateData plateData5 = new IdeaRS.OpenModel.Connection.PlateData
            {
                Name            = "P5",
                Thickness       = 0.02,
                Id              = 15,
                Material        = "S355",
                OriginalModelId = "15",
                Origin          = new IdeaRS.OpenModel.Geometry3D.Point3D
                {
                    X = -2.103,
                    Y = 3.12,
                    Z = 3.1
                },
                AxisX = new IdeaRS.OpenModel.Geometry3D.Vector3D
                {
                    X = 1,
                    Y = 0,
                    Z = 0
                },
                AxisY = new IdeaRS.OpenModel.Geometry3D.Vector3D
                {
                    X = 0,
                    Y = -1,
                    Z = 0
                },
                AxisZ = new IdeaRS.OpenModel.Geometry3D.Vector3D
                {
                    X = 0,
                    Y = 0,
                    Z = 1
                },
                Region = "M 0 0 L 0.206 0 L 0.206 0.105 L 0.195 0.115 L 0.011 0.115 L 0.0 0.105 L 0 0",
            };
            openModel.Connections[0].Plates.Add(plateData5);

            //add weld10 between memeber 2 and plate 5 - stiffener
            IdeaRS.OpenModel.Connection.WeldData weldData10 = new IdeaRS.OpenModel.Connection.WeldData()
            {
                Id = 40,
                ConnectedPartIds = new List <string>()
                {
                    plateData5.OriginalModelId, beam2Data.OriginalModelId
                },
                Start = new IdeaRS.OpenModel.Geometry3D.Point3D()
                {
                    X = -2,
                    Y = 3.005,
                    Z = 3.11
                },
                End = new IdeaRS.OpenModel.Geometry3D.Point3D()
                {
                    X = -2,
                    Y = 3.005,
                    Z = 3.11
                },
                Thickness = 0.004,
                WeldType  = IdeaRS.OpenModel.Connection.WeldType.DoubleFillet,
            };
            openModel.Connections[0].Welds.Add(weldData10);

            //add weld11 between memeber 2 and plate 5 - stiffener
            IdeaRS.OpenModel.Connection.WeldData weldData11 = new IdeaRS.OpenModel.Connection.WeldData()
            {
                Id = 41,
                ConnectedPartIds = new List <string>()
                {
                    plateData5.OriginalModelId, beam2Data.OriginalModelId
                },
                Start = new IdeaRS.OpenModel.Geometry3D.Point3D()
                {
                    X = -2.103,
                    Y = 3.10,
                    Z = 3.11
                },
                End = new IdeaRS.OpenModel.Geometry3D.Point3D()
                {
                    X = -2.103,
                    Y = 3.10,
                    Z = 3.11
                },
                Thickness = 0.004,
                WeldType  = IdeaRS.OpenModel.Connection.WeldType.DoubleFillet,
            };
            openModel.Connections[0].Welds.Add(weldData11);

            //add weld12 between memeber 2 and plate 5 - stiffener
            IdeaRS.OpenModel.Connection.WeldData weldData12 = new IdeaRS.OpenModel.Connection.WeldData()
            {
                Id = 46,
                ConnectedPartIds = new List <string>()
                {
                    plateData5.OriginalModelId, beam2Data.OriginalModelId
                },
                Start = new IdeaRS.OpenModel.Geometry3D.Point3D()
                {
                    X = -1.897,
                    Y = 3.10,
                    Z = 3.11
                },
                End = new IdeaRS.OpenModel.Geometry3D.Point3D()
                {
                    X = -1.897,
                    Y = 3.10,
                    Z = 3.11
                },
                Thickness = 0.004,
                WeldType  = IdeaRS.OpenModel.Connection.WeldType.DoubleFillet,
            };
            openModel.Connections[0].Welds.Add(weldData12);

            return(openModel);
        }
예제 #2
0
        static private OpenModel CreateConnectionGeometry(OpenModel openModel)
        {
            //Get geometrical point
            IdeaRS.OpenModel.Geometry3D.Point3D point = openModel.Point3D.Find(p => p.Name.Equals("N2", StringComparison.InvariantCultureIgnoreCase));

            //Create a new connection point
            IdeaRS.OpenModel.Connection.ConnectionPoint connectionPoint = new IdeaRS.OpenModel.Connection.ConnectionPoint();

            connectionPoint.Node = new ReferenceElement(point);
            connectionPoint.Name = point.Name;
            connectionPoint.Id   = openModel.GetMaxId(connectionPoint) + 1;

            //create the new  connection data
            var newConnectionData = new IdeaRS.OpenModel.Connection.ConnectionData();

            //create list for beams
            newConnectionData.Beams = new List <IdeaRS.OpenModel.Connection.BeamData>();

            {
                //member1D - column
                var columnMember = openModel.Member1D.Find(x => x.Id == 1);
                IdeaRS.OpenModel.Connection.ConnectedMember connectedColumn = new IdeaRS.OpenModel.Connection.ConnectedMember
                {
                    Id           = columnMember.Id,
                    MemberId     = new ReferenceElement(columnMember),
                    IsContinuous = true,
                };
                connectionPoint.ConnectedMembers.Add(connectedColumn);

                IdeaRS.OpenModel.Connection.BeamData columnData = new IdeaRS.OpenModel.Connection.BeamData
                {
                    Name                     = "Column",
                    Id                       = 1,
                    OriginalModelId          = columnMember.Id.ToString(),
                    IsAdded                  = false,
                    MirrorY                  = false,
                    RefLineInCenterOfGravity = false,
                };

                newConnectionData.Beams.Add(columnData);
            }

            {
                //member1D - beam
                IdeaRS.OpenModel.Connection.BeamData beamData = new IdeaRS.OpenModel.Connection.BeamData
                {
                    Name                     = "Beam",
                    Id                       = 2,
                    OriginalModelId          = "2",
                    IsAdded                  = false,
                    MirrorY                  = false,
                    RefLineInCenterOfGravity = false,
                };
                newConnectionData.Beams.Add(beamData);

                var column = openModel.Member1D.Find(x => x.Id == 2);
                IdeaRS.OpenModel.Connection.ConnectedMember connectedBeam = new IdeaRS.OpenModel.Connection.ConnectedMember
                {
                    Id           = column.Id,
                    MemberId     = new ReferenceElement(column),
                    IsContinuous = false,
                };
                connectionPoint.ConnectedMembers.Add(connectedBeam);
            }

            openModel.Connections.Add(newConnectionData);
            openModel.AddObject(connectionPoint);

            return(openModel);
        }