-
Install Coden
Before starting to write you first Coden tool please download and install Coden. Optionally you can verify the installation.
-
Create a Visual Studio project
Open up Visual Studio (VS2010 used in this example) and choose to create a new Class Library project. C# is used as the language of choice throughout examples, however, you may use any .NET language such as VB, F#, or C++/CLI. Make sure .NET 4.0 is selected as the target framework.
-
Add and setup assembly references
To access some of Coden's hooks we need to add a reference to Ephere.Modeling.dll assembly. This assembly was installed with your version of Coden and will be located in C:\Users\USER\AppData\Local\Ephere\Library\bin\ directory by default.
If you are developing a tool that deals with geometry you will also need to reference Ephere.Geometry.dll assembly located in the same directory.
-
Write a plugin function
Next step is to write our actual plugin code. To make things simple we reference the Ephere.Modeling and Ephere.Geometry namespaces with the
using
directive. We then add two assembly-level attributes. Pluggable attributes specifies that the whole assembly will be scanned for plugins (instead of on per-class basis). License attribute needs to be filled in using your licensing credentials obtained from us.[assembly: Pluggable] namespace MyCompany.MyPlugin { public static class MyPlugin { public static PolygonMesh3 MyMesh( float parameter ) { return new PolygonMesh3(); } } }
The namespace convention is important because it is used by some hosts to categorize your plugin. We define our plugin function
MyMesh
under a static classMyPlugin
. Since it returns aPolygonMesh3
object it will be translated as a geometry generator. It will take one floating point parameter. -
Compile and copy into Coden directory
Once you compile your plugin you need to copy it to Coden's /bin directory. This is the same directory as from where you referenced the Ephere.Modeling.dll assembly.
-
Test
The final step is to launch your host application and make sure everything is loaded properly!