This shows you the differences between two versions of the page.
|
developer:zoorhinocommonplugin [2011/11/15] dale |
developer:zoorhinocommonplugin [2012/05/23] (current) dale |
||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== Creating Rhino .NET Plug-ins that use the Zoo ====== | ||
| + | > **Developer:** //[[developer:zoo|Zoo 5.0]]// | ||
| + | > **Summary:** //Discusses how to create Rhino 5.0 plug-ins, based on RhinoCommon, that can obtain licenses from the Rhino license manager and the Zoo.// | ||
| + | |||
| + | ===== Overview ===== | ||
| + | Zoo 5.0 allows 3rd party plug-in developers to add licensing support for their products to the Zoo. | ||
| + | |||
| + | The RhinoCommon .NET SDK, new for Rhino 5.0, allows developers to write plug-ins for Rhino that use the Rhino license manager and obtain licenses from Zoo servers. | ||
| + | |||
| + | ===== Requirements ===== | ||
| + | Rhino .NET plugins are .NET Framework 4.0 assemblies. Thus, to create a .NET plug-in for Rhino 5.0, you will need one of the following development tools:: | ||
| + | |||
| + | - Microsoft Visual C# 2010 | ||
| + | - Microsoft Visual Basic .NET 2010 | ||
| + | - [[http://download.rhino3d.com/en/Rhino/5.0/RhinoCommonSdk|RhinoCommon .NET SDK]] | ||
| + | |||
| + | Also, all Rhino plug-ins that use the Rhino license manager to access the Zoo must be signed with an Authenticode certificate issued by McNeel Plug-in Security. These certificates are free, but must be requested by each developer. Developers must agree to the //Terms of Use// before a certificate is issued. For more information on plug-in signing, see the following: | ||
| + | |||
| + | [[developer:digital-signatures/create-request|Digitally Signing Plug-ins]] | ||
| + | |||
| + | ===== Creating a Rhino .NET Plug-in using RhinoCommon ===== | ||
| + | The following are the general steps required to create a Rhino plug-in. | ||
| + | - Make sure you have the [[http://www.rhino3d.com/nr.htm|Rhino 5.0]] installed. | ||
| + | - Make sure you have the [[http://download.rhino3d.com/en/Rhino/5.0/RhinoCommonSdk|RhinoCommon .NET SDK]] installed. | ||
| + | - Launch Microsoft Visual Studio 2010. | ||
| + | - Create a new project, either C# or VB.NET, based on the **RhinoCommon Plug-in** project template. | ||
| + | - Build your plug-in. | ||
| + | - Launch Rhino and use **PlugInManager** to install your plug-in (to verify that it was built properly). | ||
| + | |||
| + | ===== Adding Licensing Support to your Plug-in Project ===== | ||
| + | After you have built and tested your basic plug-in, you can add licensing support as follows: | ||
| + | - In your plug-in's **Rhino.PlugIns** inherited class, create a new method with the same signature as the **Rhino.PlugIns.ValidateProductKeyDelegate** delegate. Rhino will call into this function whenever it needs your plug-in to validate a license that is entered by a user, returned by the Rhino license manager (standalone node), or returned from a Zoo server (network node). For details, see the example RhinoCommon plug-ins listed below. | ||
| + | - In your plug-in's **OnLoad** member, call **Rhino.PlugIns.GetLicense** and pass it the build type of the license required by your product, and your delegate function. | ||
| + | - Build your plug-in. | ||
| + | - [[developer:digital-signatures/create-request|Digitally sign your plug-in.]] | ||
| + | - Launch Rhino and test your plug-in. When your plug-in is loaded for the first time, you will be prompted to enter a license. | ||
| + | {{:developer:licensenotfoundcs.png|}} | ||
| + | |||
| + | ===== Managing your License ===== | ||
| + | Rhino plug-ins that use the Rhino license manager appear in the Licenses page of the Options dialog. Here, the user is allowed to view and manage the license. | ||
| + | |||
| + | {{:developer:licensetools.png|}} | ||
| + | |||
| + | ===== Rhino Plug-in Sample ===== | ||
| + | {{:developer:testrhinoplugincs.zip|Sample RhinoCommon plug-in in Microsoft Visual C# 2010}} | ||
| + | |||
| + | {{:developer:testrhinopluginvb.zip|Sample RhinoCommon plug-in in Microsoft Visual Basic .NET 2010}} | ||
| + | |||
| + | \\ | ||
| + | |||
| + | {{tag>Developer zoodev}} | ||