Problems with c# blocks

Hello everyone!
Few of my c# blocks stopped working randomly. They worked before, but when i came back to work, multiple c# blocks had output as . I haven’t changed them for at least a month.
I still have windows 7 on this computer. At first, i tried to run my GH definition on different pc, that has windows 10. On that pc everything worked fine. I figured maybe there was .net update and my pc (win 7) wasn’t updated, soo i asked IT to update .net for me. After that everything worked until next day when the problem started again.
Here is the code for one of the blocks:

using Tekla.Structures;
using TSM = Tekla.Structures.Model;
using TSG = Tekla.Structures.Geometry3d;
...
private void RunScript(List<object> Columns, ref object Point)
  {
    var pList = new List<TSG.Point>();
    for(int i = 0; i < Columns.Count; i++){
      var column = (TSM.Beam) Columns[i];

     var x = 0.0;
      var y = 0.0;
      var z = 0.0;

      column.GetReportProperty("COG_X", ref x);
      column.GetReportProperty("COG_Y", ref y);
      column.GetReportProperty("COG_Z", ref z);
      TSG.Point temp = new TSG.Point(x, y, z);
      pList.Add(temp);
    }
    Point = pList;
  }

image

Can anyone suggest what to do or how to fix this?

just a FYI, I edited your post to use proper code-block markup (enclose code in triple backticks).

Have you tried sprinkling calls to Print around your code to see you’re actually getting what you think you’re getting? Re-add the out -output and connect a Panel to it to see the results of the Print calls.

I added out, it threw cast error, but i can’t seem to fix it.


image

image
I am passing Columns list as a beam

I don’t know Tekla, but it looks like you’re passing in a list with mixed Beam and PolyBeam? Maybe refer to the Tekla documentation and see if they have a common base class you can use for your purposes.

The exception will be the cause for your <null> output.

Yeah that was it, i accidentally selected weird PolyBeams in Tekla, soo they got passed down and mixed with Beams. Thanks for help!