private void RunScript(DataTree<Polyline> c, DataTree<int> storey, DataTree<Point3d> vpt, int high, ref object A)
{
DataTree<Polyline> temp = new DataTree<Polyline>();
GH_Path pth = new GH_Path(0, 0);
temp.Branch(pth)[0] = c.Branch(0)[0];
A = temp;
}
why the output is:error:object reference not set to an instance of an object(of the red line)?
Thank you very much!!!
David Rutten
"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.
In this case your temp DataTree has been constructed but it is empty. I.e. it has no paths and no branches. So when you ask for the branch at pth, you'll get a null reference in return. Then you try and call [0] on that null reference, which is what throws the exception.
I cannot tell you how to fix it until you tell me what it is you're trying to do.
--
David Rutten
david@mcneel.com
Poprad, Slovakia
Dec 5, 2011
aleksmkd
Hi im trying to understand this definition of galapagos and geco... but it gives me this error...
can you please help me?
tnx
Aleks
Feb 12, 2014