This is an error occurred in the devlopment of a Grasshopper Plugin, when using following code:
protected override void SolveInstance(IGH_DataAccess DA)
string searchFor = “%”;
GH_String pattern = null;
DA.GetData<GH_String>(0, ref pattern);
GH_Number thickness = null;
DA.GetData<GH_Number>(1, ref thickness);
GH_String type = null;
DA.GetData<GH_String>(2, ref type);
GH_String strNew = null;
strNew.Value = pattern.Value.Replace(searchFor, thickness.Value.ToString());
// output has two fields, one new string and the type name
List<GH_String> output = new List<GH_String>();
David Rutten explained the question in the discussion: http://www.grasshopper3d.com/forum/topics/error-object-reference-not-set-to-an-instance-of-an-object-1
“Object reference not set to an instance of an object” is the most common exception in .NET as far as I know. It means you’re trying to call a method on a class which doesn’t exist. Or rather, a class which hasn’t been instantiated.
GH_Structure and IGH_Goo Interface are two terms that appear a lot while I try to develop a Grasshopper Component. I’m trying to understand them in C#.
Definations from Grasshopper SDK Help
GH_Structure<T> Class: Represents a data tree where each branch has a unique path
IGH_Goo Interface: Base interface for all Data inside Grasshopper. Every parameter must implement a type of Goo.
<li>Most ES programs assume the indoor air is completely mixed and with uniform properties. This may not be true for most buildings.</li>
<li>ES programs do not solve the air movement and contaminant transportation in the space.</li>
<li>detailed time-dependent and spatial distribution of many parameters</li>
<li>accurate indoor air velocity and temperature distributions</li>
<li>needs a lot of computation time</li>
- The indoor air temperature gradient and covective heat transfer from CFD can used in an ES model for more accurate energy calculation.
- CFD can accurately simulate natural ventilation driven by wind effect and stack effect, that can also be used in ES model.
- ES can provide more accurate flow and thermal boundary conditions for CFD simulation
CFD can also be exteneded to solve heat transfer in solid material, even with an appropriate radiation model, HVAC system model, and plant model, the extended CFD program can have the functions of both ES and CFD programs. But it is very eompztationally expensive.