What is equalent of:
new Grasshopper.DataTree()
but with IGH_Structure ?
What is equalent of:
new Grasshopper.DataTree()
but with IGH_Structure ?
Both DataTree and GH_Structure are generic types, meaning you must include a type constraint at construction:
var tree = new DataTree<int>();
var structure = new GH_Structure<GH_Integer>();
It was Gh _Integer. Thank you.
GH_Structure<T> places a constraint on the T that it must be of type IGH_Goo. This is the principle reason why DataTree<T> was created, to get rid of this constraint inside scripting components.
When working with visual studio, it is better use datatrees or gh_structure? (There is additional casting in datatrees or there is no big difference?)
DataTrees are only really meant to be used inside scripting components. GH_Structure is the more mature type that Grasshopper deals with itself.