Hello all,
I’m working on a grasshopper component in C# that takes input from a datatree with multiple datatypes (strings, ints, floats all packed in one). I understand that to import this type, one needs to use IGH_Goo when using GetDataTree(). However, when I do so I get the following error:
The code snippet (if needed) is below:
protected override void RegisterInputParams(GH_Component.GH_InputParamManager pManager)
{
pManager.AddNumberParameter("Database", "DTB", "Data", GH_ParamAccess.tree);
}
/// <summary>
/// Registers all the output parameters for this component.
/// </summary>
protected override void RegisterOutputParams(GH_Component.GH_OutputParamManager pManager)
{
pManager.AddGenericParameter("Connection", "C", "Connector_information", GH_ParamAccess.list);
}
/// <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)
{
List<EleType> members = new List<EleType>();
int connection = 0;
int design_standard = 0;
GH_Structure<IGH_Goo> DB;
if (!DA.GetDataList(0, members)) return;
if (!DA.GetData("Connection", ref connection)) return;
if (!DA.GetData("Design Standard", ref design_standard)) return;
if (!DA.GetDataTree(3, out DB)) return;
}
Where am I going wrong ?