Hello,
I downloaded and edited the script from Sajesh in this thread:
Specifically, I just need to be able to edit the size of many existing welds in a Tekla Structures model, with values already available through separate Grasshopper components.
So my code is:
private void RunScript(System.Object Saldatura, double SizeA, double SizeB, ref object Weld)
{
Tekla.Structures.Model.Weld Saldat = (Tekla.Structures.Model.Weld) Saldatura;
Saldat.SizeAbove = SizeA;
Saldat.SizeBelow = SizeB;
Saldat.Modify();
Weld = Saldat;
new Tekla.Structures.Model.Model().CommitChanges();
}
The code works on small groups of welds, but it gets REALLY slow when connected to the Tekla Object Pipeline to get all the welds (there are 1500 weld objects), it seems to hang and finally crash.
I’m sure the code can be optimized and I think maybe the problem lies in the CommitChanges line, but I don’t have enough understanding of C# to be able to spot the bottleneck.
Can someone point me in the right direction?
Thank you very much