protected override void SolveInstance(IGH_DataAccess DA) { bool go = false; DA.GetData(2, ref go); if (go) { List <FD_Setting> settings = new List <FD_Setting>(); DA.GetDataList(0, settings); List <string> IDs = new List <string>(); DA.GetDataList(1, IDs); List <string> messages = new List <string>(); foreach (FD_Setting set in settings) { messages.AddRange(set.Update()); } CSV_Output csv_out = new CSV_Output(); csv_out.IDs = IDs; messages.Add(csv_out.Output()); DA.SetDataList(0, messages); } }
protected override void SolveInstance(IGH_DataAccess DA) { DA.GetData(2, ref reset); DA.GetData(3, ref limitation); DA.GetData(4, ref goon); if (reset) { counter = 0; Message = "Waiting..."; } if (counter != 0 && goon && !reset) { List <FD_Setting> settings = new List <FD_Setting>(); DA.GetDataList(0, settings); List <string> messages = new List <string>(); foreach (FD_Setting set in settings) { messages.AddRange(set.Update()); } CSV_Output csv_out = new CSV_Output(); List <string> ids = new List <string>(); DA.GetDataList(1, ids); if (ids.Count != 0) { csv_out.IDs = ids; } else { csv_out.IDs = Tools.ids_in_loop; } messages.Add(csv_out.Output()); DA.SetDataList(0, messages); } bool trigger = counter != limitation && goon && !reset; if (trigger) { Message = "Looping"; } if (counter == limitation) { Message = "Done"; } DA.SetData(1, counter); DA.SetData(2, trigger); }