i am developing a plugin for sorting length, i am new to c #
I got that in the main class, there is a method that returns a list of lists and in the grasshopper, at the exit from the node, this output outputs null values
For what you are trying to output, you are trying to output a tree.
GH_ParamAccess.tree
and for the conversion:
GH_Structure<GH_Integer> tree = new GH_Structure<GH_Integer>();
for(int i = 0; i < List.Count;i++)
{
tree.AppendRange(List[i].Select(j=>new GH_Integer(j)), new GH_Path(new int[]{0,i}));
}
DA.SetDataTree(0,tree);
this is how I did the conversion, but the environment throws errors (((
GH_Structure<GH_Integer> Length = new GH_Structure<GH_Integer>
for(int i = 0; i < List.Count;i++)
{
Length.AppendRange(List[i].Select(j=>new GH_Integer(j)), new GH_Path(new int{0,i}));
}
DA.SetDataTree(0,Length);
GH_Structure<GH_Integer> Tree= new GH_Structure<GH_Integer>
for(int i = 0; i < Length.Count;i++)
{
Tree.AppendRange(Length[i].Select(j=>new GH_Integer(j)), new GH_Path(new int{0,i}));
}
DA.SetDataTree(0,Tree);