/// <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) { var parameters = new List<RhinoNestKernel.Nesting.RhinoNestObject>(); //Declaration. var Object = new List<Guid>(); var orientation = new OrientationGoo(); var criterion = new CriterionGoo(); var copies = 0; var priority = 0; //clear value and get the objects. if (!da.GetDataList(0, Object)) return; da.GetData(1, ref copies); da.GetData(2, ref priority); da.GetData(3, ref orientation); da.GetData(4, ref criterion); var organizer = new RhinoNestKernel.Curves.OrganizeObjects(Object); var res = organizer.Sort(); foreach (var rhinoNestObject in organizer.Result) { rhinoNestObject.Parameters.Priority = priority; rhinoNestObject.Parameters.Copies = copies; rhinoNestObject.Parameters.Criterion = criterion.Value.Constraint; rhinoNestObject.Parameters.Orientation = orientation.Value.Constraint; parameters.Add(rhinoNestObject); } //Put the list to Output. da.SetDataList(0, parameters); }
/// <summary> /// This is the method that actually does the work. /// </summary> /// <param name="da">IGH_DataAccess: The DA object is used to retrieve from inputs and store in outputs.</param> protected override void SolveInstance(IGH_DataAccess da) { var parameters = new List<RhinoNestKernel.Nesting.RhinoNestObject>(); //Declaration. var Object = new List<Curve>(); var orientation = new OrientationGoo(); var criterion = new CriterionGoo(); var copies = 0; var priority = 0; //clear value and get the objects. if (!da.GetDataList(0, Object)) return; da.GetData(1, ref copies); da.GetData(2, ref priority); da.GetData(3, ref orientation); da.GetData(4, ref criterion); //asignament of all objects on list. foreach (Curve t in Object) { var obj = new RhinoNestKernel.Nesting.RhinoNestObject(t) { Parameters = { Copies = copies, Priority = priority, Orientation = orientation.Value.Constraint, Criterion = criterion.Value.Constraint } }; parameters.Add(obj); } //Put the list to Output. da.SetDataList(0, parameters); }