ComponentInputGetEnumerator Method |
Returns an enumerator that iterates through a collection.
Namespace: Tekla.Structures.Model
Assembly: Tekla.Structures.Model (in Tekla.Structures.Model.dll) Version: 2024.0.0+a110b435391768740483e3032720a566518c9a63
Syntax
Return Value
Type: IEnumeratorAn IEnumerator object that can be used to iterate through the collection.
Implements
IEnumerableGetEnumeratorExamples
using Tekla.Structures.Model; using Tekla.Structures.Geometry3d; using System; using System.Collections; public class Example { public void Example1() { Beam B = new Beam(new Point(12000, 0, 0), new Point(12000, 0, 6000)); B.Profile.ProfileString = "380*380"; B.Material.MaterialString = "K40-1"; if (B.Insert()) { Component C = new Component(); C.Name = "Component Test"; C.Number = 30000063; ComponentInput CI = new ComponentInput(); CI.AddInputObject(B); C.SetComponentInput(CI); C.LoadAttributesFromFile("standard"); C.SetAttribute("side_bar_space", 333.0); if (!C.Insert()) { Console.WriteLine("Component Insert failed"); } else { // test fetching component input ComponentInput ComponentSel = C.GetComponentInput(); IEnumerator Enumerator = ComponentSel.GetEnumerator(); while (Enumerator.MoveNext()) { InputItem ObjectInput = Enumerator.Current as InputItem; if (ObjectInput.GetInputType() == InputItem.InputTypeEnum.INPUT_1_OBJECT) { Beam BeamInput = ObjectInput.GetData() as Beam; } } } } } }
See Also