idea-statica / iom-examples

Examples of using IDEA StatiCa IOM API
MIT License
8 stars 4 forks source link

System.Reflection.TargetInvocationException: 'Exception has been thrown by the target of an invocation.' #4

Closed GRamsaroep closed 4 years ago

GRamsaroep commented 5 years ago

Hi,

When i try to edit the input of the members of the example, i get errors everytime running the code. For example: i want to show the beams M4, M1 and M2. I changed the code and added one member extra to the ones that are needed to be shown. But everytime when i run the code, it doesnt work and get stuck at the Invoke methode. It gives the following error:

System.Reflection.TargetInvocationException: 'Exception has been thrown by the target of an invocation.'

KeyNotFoundException: The given key was not present in the dictionary.

Even when i just want to show member M1 it still gives an error. I think its the problem with the point maybe, because when i didnt change the point node (connection node) it worked with just showing the 2 members M1 and M3.

GRamsaroep commented 5 years ago

i have seen that it goes wrong when i change the members only, the starting node connection has no influence i think. it goes wrong at the Import methode. Is give me the same error every time.

methodImport.Invoke(obj, array);

This is the full details:

System.Reflection.TargetInvocationException HResult=0x80131604 Message=Exception has been thrown by the target of an invocation. Source=mscorlib StackTrace: at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters) at IOM.SteelFrameDesktop.Program.Main(String[] args) in C:\Users\g.ramsaroep\Documents\IDEA open API examples\iom-examples-master\IOM.SteelFrameDesktop\Program.cs:line 53

Inner Exception 1: KeyNotFoundException: The given key was not present in the dictionary.

mpospisil commented 5 years ago

If key is not in the dictionary it iom is not created correctly - the problem is on your side. To be able to faind the problem we need to check your data (your iom model)

GRamsaroep commented 5 years ago

This i what i have changed only. THe member 1 to member 4

//member1D 4 var member4 = openModel.Member1D.Find(x => x.Id == 4); IdeaRS.OpenModel.Connection.ConnectedMember conMb4 = new IdeaRS.OpenModel.Connection.ConnectedMember { Id = member4.Id, MemberId = new ReferenceElement(member4), IsContinuous = true, }; connection.ConnectedMembers.Add(conMb4);

        IdeaRS.OpenModel.Connection.BeamData beam4Data = new IdeaRS.OpenModel.Connection.BeamData
        {
            Name = "M4",
            Id = 4,
            OriginalModelId = member4.Id.ToString(),
            IsAdded = false,
            MirrorY = false,
            RefLineInCenterOfGravity = false,
        };
        openModel.Connections[0].Beams.Add(beam4Data);
mpospisil commented 5 years ago

it seems member #1 is still referenced in your model by any other entity. You can not change id without other changes in your model

GRamsaroep commented 5 years ago

I will paste the whole code underneath the Fill fucntion. The other code isn't changed. I thought it works like this: The other functions, like AddNodes, AddMembers etc, will "Load" an geometry with Loads and members in the project and the Fill command will fill in the project with members chosen from the loaded model at the background. Because i wanted to test is i commented all the other code so only the members first will be projected in the file and after that i wanted to make the steps to add plates and bolts etc by hand.

What changes do i need to make then?

`static private OpenModel Fill(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 4
        IdeaRS.OpenModel.Connection.BeamData beam4Data = new IdeaRS.OpenModel.Connection.BeamData
        {
            Name = "M4",
            Id = 4,
            OriginalModelId = "4",
            IsAdded = false,
            MirrorY = false,
            RefLineInCenterOfGravity = false,
        };
        openModel.Connections[0].Beams.Add(beam4Data);

        var member4 = openModel.Member1D.Find(x => x.Id == 4);
        IdeaRS.OpenModel.Connection.ConnectedMember conMb4 = new IdeaRS.OpenModel.Connection.ConnectedMember
        {
            Id = member4.Id,
            MemberId = new ReferenceElement(member4),
            IsContinuous = false,
        };
        connection.ConnectedMembers.Add(conMb4);

        //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),
        //      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;
    }`
GRamsaroep commented 5 years ago

i have found the problem. It was with the references to the other functions where the loadcases etc are being added to the model.

mpospisil commented 5 years ago

I have expected that