Plugin
ReferencesEvery grasshopper plugin assembly must implement a single public type with a public, parameter-less constructor derived from this class.
Constructors
Plugin
#Base constructor. Plugin identity (id, name, info and version) is by default sourced from assembly attributes — see the individual properties.
protected Plugin()
Properties
Author
#Name of plugin author. By default this is read from the Rhino
[assembly: PlugInDescription(DescriptionType.Organization)] attribute, falling back to [assembly: AssemblyCompany].Contact
#Contact details of plugin author. By default this is read from the Rhino
[assembly: PlugInDescription(DescriptionType.Email)] attribute.Copyright
#plugin copyright message. By default this is read from the
[assembly: AssemblyCopyright] attribute. Since that attribute is a compile-time constant, a {now} placeholder within it is expanded to the current year when the plugin is loaded.DefaultLicence
#Gets the default description for licences which tracks the Rhino licence, based on the the local user name and organisation.
DocumentationFolder
#Gets the documentation folder for this plugin. Ideally this folder contains subfolders for supported languages such as "English" and "Deutsch" etc. Grasshopper will then know which one to pick based on current language settings. If no language subfolders exist, the folder contents are used directly. By default, any folder called "Documentation" next to the plugin assembly will be returned, or otherwise the folder which contains all *.term, *.spec, and *.topic files within the assembly folder.
Id
#Gets the ID of this plugin. By default this is read from the
[assembly: Guid] attribute, which is the same id Rhino uses to identify the plugin.Info
#Gets a short description of this plugin. By default this is read from the
[assembly: AssemblyDescription] attribute.LicenceAgreement
#Gets the licence agreement text for this plugin. If the agreement string starts with 'http' or 'www' a web-address lookup is implied.
LicenceDescription
#Gets the licence description for this plugin, for example 'trial', 'commercial', 'free', 'educational'...
Name
#Gets the name of this plugin. By default this is read from the
[assembly: AssemblyTitle] attribute.SatelliteAssemblies
#Override this method if this plugin has satellite assemblies which provide additional components, conversion methods, type assistants etc.
Version
#Gets the version of this particular build of this plugin. By default this is read from the
[assembly: AssemblyFileVersion] attribute, which is the same version Rhino reports for the plugin (the build date stamp).Methods
HarvestCustomTypes
#Perform custom type creation, in case your plugin does not ship with compiled types.
protected virtual void HarvestCustomTypes()
OnLoaded
#This method will be called after type harvesting completes, but before the plugin is added to the available framework. Throw from this method to prevent this plugin from becoming available.
public virtual void OnLoaded()
OwnsAssistant
#Gets whether this plugin owns a particular type assistant type.
Returns: True if this plugin owns that type.
OwnsDataType
#Gets whether this plugin owns a particular data type.
Returns: True if this plugin owns that type.
OwnsObject
#Gets whether this plugin owns a particular document object type.
Returns: True if this plugin owns that type.
PlugInDescription
#Reads a Rhino PlugInDescriptionAttribute of the given kind from the plugin assembly, returning an empty string when it is absent. These are the same attributes Rhino's plugin manager reads.