Hi all,
I'm facing the following problem, which really stuck me :
I've created a custom mesh parameter within a C# project called "Gridshell". This project gives geometric tools to generate gridshells on nurbs surfaces. It references GH_IO.dll, Grasshopper.dll and Rhinocommon.dll.
Custom Class : GS_Mesh
Custom Type : GHType_GSMesh : GH_Goo<GSMesh>
Custom Parameter : GHParam_GSMesh : GH_Param<GHType_GSMesh>
Now, i'm developing a set of structural analysis components to relax gridshells. Those components are grouped in a new project called "Marsupilami".
Naturally my components would eat GS_Mesh objects and relax them. My project references GH_IO.dll, Grasshopper.dll, Rhinocommon.dll and Gridshell.dll.
But I can't build my code because I get the following error, where I try to instantiate a GHType_GSMesh object :
Errorr 3 The type 'Grasshopper.Kernel.Types.GH_Goo`1<T0>' is defined in an assembly that is not referenced. You must add a reference to assembly 'Grasshopper, Version=1.0.0.20, Culture=neutral, PublicKeyToken=null'. C:\Documents and Settings\l.dupeloux.TESS\Mes documents\Dropbox\Dev\Marsupilami\1 - visual studio\Marsupilami\GHComponents\GHComponent_GSMeshRelax.cs 97 13 Marsupilami
I've checked many times but the assembly seems to be referenced in both projects (local copy = false) in the required version (1.0.0.20).
Do you have any idea how to solve this problem ?
Many Thanks
Lionel
Lionel
I've found this, but it doesn't work for me :
http://aftabkalhoro.wordpress.com/2011/08/03/the-type-is-defined-in...
Lionel
Aug 6, 2013
Thibault Schwartz
Hi Lionel,
You will have to import the namespace in which you declared your custom class, for exemple:
using Gridshell.Types;
Then you should be able to use your class, and if you have an empty constructor set in your class there is no reason you could not use it like that:
GSMesh MyMesh = new GSMesh();
or else,
GSMesh MyMesh = null;
I hope it helps,
T.
Aug 6, 2013