/// <summary> /// This is the method that actually does the work. /// </summary> /// <param name="DA">The DA object is used to retrieve from inputs and store in outputs.</param> protected override void SolveInstance(IGH_DataAccess DA) { structure = new StructureType(); if (!DA.GetData(0, ref structure)) { return; } structure.GeneratePrincipalStressLines(); List <Curve> mainStresses = new List <Curve>(); for (int i = 0; i < structure.NumberOfElements; i++) { if (Math.Abs(structure.PrincipalStresses[i].X) < Math.Abs(structure.PrincipalStresses[i].Y)) { mainStresses.Add(structure.PrincipalStressLinesY[i].ToNurbsCurve()); } else { mainStresses.Add(structure.PrincipalStressLinesX[i].ToNurbsCurve()); } } DA.SetDataList(0, mainStresses); }