Hello Everyone,
recently I’ve begun a journey with ZeroTouchNodes and TeklaStructures API.
I started with generating beams inside Tekla. With one node I can create beams with the different material, class, profile etc.
BUT the problem appears when I try to modify selected beams (using another node).
CODE:
This method/node takes Dynamo’s Lines as an input. Then it should assign start/end point of each Dynamo’s line to each Tekla’s beam. However, script takes all beams in Tekla, puts them in one position on every beam’s place. In another words: scrip iterates through Tekla’s beams AND Dynamo’s lines (n x n iterations) BUT it should not be possible (see fro loop). GIF:
You can see how all Tekla’s beams are placed in first Dynamo’s line position and then in second Dyn’s line position, one by one.
-
Does anyone know how to access a list of Dynamo’s lines (geometry objects)?
Lines cannot be put in foreach loop because “Line does not contain a public instance definition for GetEnumerator”. How does C# is dealing with multiple geometry elements? As I wrote before creating beams in Tekla using Dynamo’s lines work just fine so ‘c#’ iterates somehow by these DynLines. -
Or maybe Dynamo set somewhere, somehow lancing to crossing? (node’s lancing is set to shortest)
CODE responsible for generating multiple beams in Tekla using Dynamo’s Lines, it’s not even a loop, but it works.
TSG.Point P1 = new TSG.Point(Line.StartPoint.X, Line.StartPoint.Y, Line.StartPoint.Z);
TSG.Point P2 = new TSG.Point(Line.EndPoint.X, Line.EndPoint.Y, Line.EndPoint.Z);
TSM.Beam beam = new TSM.Beam((TSM.Beam.BeamTypeEnum)BeamType);
beam.StartPoint = P1;
beam.EndPoint = P2;
beam.Material.MaterialString = Material;
beam.Profile.ProfileString = Profile;
beam.Class = Class;
beam.Insert();
model.CommitChanges();
MultiOutputPort = new Dictionary<string, object>
Kind Regards
M