Hi everyone,
I am trying to use DuplicateCast to convert a GH_Structure containing GH_Number to its parent type IGH_Goo.
The issue I am facing is that the returned tree contains the correct number of branches, but they are empty. Here is my code:
GH_Structure<GH_Number> tree = null;
if (!DA.GetDataTree(attribute.mFullName, out tree)) return;
GH_Structure<IGH_Goo> convertedTree = tree.DuplicateCast<IGH_Goo>(IGHGooConverter);
With IGHGooConverter:
public static IGH_Goo IGHGooConverter(GH_Number obj) {
return obj;
}
Found that in this old post
Am I using DuplicateCast correctly?
Thanks for your help,
Loris