PlugIn
A general purpose utility plug-in that can contain one or more commands.
Inheritance Hierarchy
System.Object
Rhino.PlugIns.PlugIn
Rhino.PlugIns.DigitizerPlugIn
Rhino.PlugIns.FileExportPlugIn
Rhino.PlugIns.FileImportPlugIn
Rhino.PlugIns.RenderPlugIn
Namespace: Rhino.PlugIns
Assembly: RhinoCommon (in RhinoCommon.dll)
Syntax
public class PlugIn
The PlugIn type exposes the following members.
Constructors
Name
Description
Protected Method
PlugIn
Initializes a new instance of the PlugIn class
Properties
Name
Description
Public Property
AddToHelpMenu
Called by Rhino to determine if the plug-in name should be added to the Rhino Help/Plug-ins menu.
Public Property
Static Member
AskOnLoadProtection
If true, Rhino will display a warning dialog when load-protected plug-ins are attempting to load. If false, load-protected plug-ins will silently not load.
Public Property
Assembly
Source assembly for this plug-in.
Public Property
Description
Returns the description of the plug-in, as found in the plug-in’s assembly attributes.
Public Property
Id
Returns the Guid, or unique Id, of the plug-in.
Public Property
Static Member
InstalledPlugInCount
Returns the number of installed Rhino plug-ins.
Public Property
LicenseId
Public Property
LoadAtStartup
Obsolete.
Public Property
LoadTime
Plug-ins are typically loaded on demand when they are first needed. You can change this behavior to load the plug-in at during different stages in time by overriding this property.
Protected property
LocalPlugInName
Optionally override this to provide a localized plug-in name
Public Property
Name
Returns the name of the plug-in, as found in the plug-in’s assembly attributes.
Public Property
Settings
Persistent plug-in settings.
Public Property
SettingsDirectory
Get the plug-in’s settings directory. This is the directory where the plug-in’s persistent settings files are saved. This directory will be located in the user’s profile folder. Note, this does not verify the directory exists.
Public Property
SettingsDirectoryAllUsers
Get the plug-in’s “all users” settings directory. This directory will be located in the system’s program data folder. Note, this does not verify the directory exists.
Public Property
Version
Returns the version of the plug-in, as found in the plug-in’s assembly attributes.
Public Property
WindowPositionSettings
Methods
Name
Description
Protected Method
AskUserForLicense
Public Method
CommandSettings
Protected Method
CreateCommands
Called right after plug-in is created and is responsible for creating all of the commands in a given plug-in. The base class implementation Constructs an instance of every publicly exported command class in your plug-in’s assembly.
Public Method
DisplayHelp
Called by Rhino if AddToHelpMenu is true and menu item associated with this plug-in is selected.
Protected Method
DocumentPropertiesDialogPages
Override this function if you want to extend the document properties sections of the options dialog. This function is called whenever the user brings up the Options dialog.
Public Method
Equals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Protected Method
Finalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public Method
Static Member
Find(Assembly)
Finds the plug-in instance that was loaded from a given assembly.
Public Method
Static Member
Find(Guid)
Finds the plug-in instance that was loaded from a given plug-in Id.
Public Method
Static Member
FlushSettingsSavedQueue
Public Method
GetCommands
All of the commands associated with this plug-in.
Public Method
Static Member
GetEnglishCommandNames
Gets names of all “non-test” commands for a given plug-in.
Public Method
GetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public Method
Static Member
GetInstalledPlugInFolders
Public Method
Static Member
GetInstalledPlugInNames.
Returns the names of all installed Rhino plug-ins.
Public Method
Static Member
GetInstalledPlugInNames(PlugInType, Boolean, Boolean)
Gets a list of installed plug-in names. The list can be restricted by some filters.
Public Method
Static Member
GetInstalledPlugInNames(PlugInType, Boolean, Boolean, Boolean)
Gets a list of installed plug-in names. The list can be restricted by some filters.
Public Method
Static Member
GetInstalledPlugIns.
Get a list of all registered plug-in’s regardless of if they are loaded or not.
Public Method
Static Member
GetInstalledPlugIns(Boolean)
Get a list of all registered plug-in’s regardless of if they are loaded or not.
Protected Method
GetLicense(LicenseBuildType, ValidateProductKeyDelegate, OnLeaseChangedDelegate)
Verifies that there is a valid product license for your plug-in, using the Rhino licensing system. If the plug-in is installed as a standalone node, the locally installed license will be validated. If the plug-in is installed as a network node, a loaner license will be requested by the system’s assigned Zoo server. If the Zoo server finds and returns a license, then this license will be validated. If no license is found, then the user will be prompted to provide a license key, which will be validated.
Protected Method
GetLicense(LicenseCapabilities, String, ValidateProductKeyDelegate, OnLeaseChangedDelegate)
Verifies that there is a valid product license for your plug-in, using the Rhino licensing system. If the plug-in is installed as a standalone node, the locally installed license will be validated. If the plug-in is installed as a network node, a loaner license will be requested by the system’s assigned Zoo server. If the Zoo server finds and returns a license, then this license will be validated. If no license is found, then the user will be prompted to provide a license key, which will be validated.
Protected Method
GetLicenseOwner
Get the customer name and organization used when entering the product license.
Public Method
Static Member
GetLoadProtection
Get load protection state for a plug-in
Public Method
Static Member
GetPlugInInfo
Returns detailed information about an installed Rhino plug-in.
Public Method
GetPlugInObject
Public Method
Static Member
GetPluginSettings
Public Method
GetType
Gets the Type of the current instance.
(Inherited from Object.)
Public Method
Icon
Returns the plug-in’s icon in bitmap form.
Public Method
Static Member
IdFromName
Gets the id of an installed plug-in giving the plug-in’s name.
Public Method
Static Member
IdFromPath
Gets the id of an installed plug-in giving the plug-in’s file path.
Public Method
IsTextureSupported
Returns true if this renderer can render the texture natively without needing it to be baked into a bitmap, false otherwise. By default, returns false for all textures.
Public Method
Static Member
LoadComputeExtensionPlugins
Used by compute’s startup code to load plug-ins that have registered custom endpoints
Public Method
Static Member
LoadPlugIn(Guid)
Loads an installed plug-in.
Public Method
Static Member
LoadPlugIn(String, Guid.)
Attempt to load a plug-in at a path. Loaded plug-ins are remembered by Rhino between sessions, so this function can also be considered a plug-in installation routine
Public Method
Static Member
LoadPlugIn(Guid, Boolean, Boolean)
Loads an installed plug-in.
Protected Method
MemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public Method
Static Member
NameFromPath
Gets a plug-in name for an installed plug-in given the path to that plug-in.
Protected Method
ObjectPropertiesPages(List.ObjectPropertiesPage.)
Obsolete.
Override this function is you want to extend the object properties dialog
Protected Method
ObjectPropertiesPages(ObjectPropertiesPageCollection)
Override this function is you want to extend the object properties dialog. This method will be called each time a new document is created for each instance of a object properties panel. On Windows there will be a single panel per document but on Mac there may be many properties panel per document.
Protected Method
OnLoad
Is called when the plug-in is being loaded.
Protected Method
OnShutdown
Protected Method
OptionsDialogPages
Override this function if you want to extend the options dialog. This function is called whenever the user brings up the Options dialog.
Public Method
Static Member
PathFromId
Gets the path to an installed plug-in given the id of that plug-in
Public Method
Static Member
PathFromName
Gets the path to an installed plug-in given the name of that plug-in
Public Method
Static Member
PlugInExists
Verifies that a Rhino plug-in is installed.
Public Method
Static Member
RaiseOnPlugInSettingsSavedEvent
Raise any pending OnPlugInSettingsSaved events, the events are normally queued while a command is running and fired while Rhino is in an idle state. Calling this method will raise any pending changed events regardless of Rhino’s current idle state or if a command is running.
Protected Method
ReadDocument
Called whenever a Rhino document is being loaded and plug-in user data was encountered written by a plug-in with this plug-in’s GUID.
Protected Method
RegisterCommand
Protected Method
ResetMessageBoxes
Protected Method
ReturnLicense
Returns, or releases, a product license that was obtained from the Rhino licensing system. Note, most plug-ins do not need to call this as the Rhino licensing system will return all licenses when Rhino shuts down.
Public Method
Static Member
SavePluginSettings
Public Method
SaveSettings
Write settings to disk which will raise a
SettingsSaved
event.Protected Method
SetLicenseCapabilities
Public Method
Static Member
SetLoadProtection
Set load protection state for a certain plug-in
Protected Method
ShouldCallWriteDocument
Called whenever a Rhino is about to save a .3dm file. If you want to save plug-in document data when a model is saved in a version 5 .3dm file, then you must override this function to return true and you must override WriteDocument().
Public Method
ToString
Returns a string that represents the current object.
(Inherited from Object.)
Protected Method
WriteDocument
Called when Rhino is saving a .3dm file to allow the plug-in to save document user data.
Events
Name
Description
Public Event
SettingsSaved
This event is raised when an instance of Rhino has modified the external settings file associated with this plug-in’s
Settings
property.Public Event
Static Member
UnknownUserData
This event is raised when a 3dm file is loaded with unknown user data, and the plug-in to handle it could not be loaded.