In the c# component, I set an output named “y”, and
double [, ] mylist = new double [2,3];
and initiate mylist;
y = mylist;
but y is always a single list like double[], rather than a tree object double[,]
is there any way to set my output y to a tree list, or I have to arrange it using other component provided in grasshopper, I tried the later but I think it is a little bit trivial.
If you want to output a tree, your only option is to create an actual DataTree. GH1 is not smart enough to convert nested arrays or multi-dimensional arrays into trees.
Any data you output, if it isn’t already of type IGH_Goo, will be interpreted by Grasshopper and converted (if possible) into a known type. Anything which provides an IEnumerable interface will be converted into a collection. If you want to maintain your 2D array, you must wrap it into a GH_ObjectWrapper before outputting it, that will prevent GH from trying to inspect and convert it.