Constructors
DigitizerPlugIn
#protected DigitizerPlugIn()
Properties
Description
Returns the description of the plug-in, as found in the plug-in's assembly attributes.
DigitizerUnitSystem
#Unit system of the points the digitizer passes to SendPoint(). Rhino uses this value when it calibrates a digitizer. This unit system must be not change.
LicenseId
LoadAtStartup
obsoleteUse LoadTime virtual property instead
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.
LocalPlugInName
Optionally override this to provide a localized plug-in name
Name
Returns the name of the plug-in, as found in the plug-in's assembly attributes.
PointTolerance
#The point tolerance is the distance the digitizer must move (in digitizer coordinates) for a new point to be considered real rather than noise. Small desktop digitizer arms have values like 0.001 inches and 0.01 millimeters. This value should never be smaller than the accuracy of the digitizing device.
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.
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.
Version
Returns the version of the plug-in, as found in the plug-in's assembly attributes.
WindowPositionSettings
Methods
AskUserForLicense
protected bool AskUserForLicense()
productBuildType,
standAlone,
textMask,
parentWindow,
validateProductKeyDelegate,
onLeaseChangedDelegate
CommandSettings
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.
protected virtual void CreateCommands()
DisplayHelp
Called by Rhino if AddToHelpMenu is true and menu item associated with this plug-in is selected.
public virtual bool DisplayHelp()
nint
windowHandle
Native Window handle of the active Rhino interface.
Returns: true = Help displayed successfully, false = Error displaying help
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.
protected virtual void DocumentPropertiesDialogPages()
doc,
document that the pages are set up for
pages
list of pages to add your custom options dialog page(s) to.
EnableDigitizer
#Called by Rhino to enable/disable input from the digitizer. If enable is true and EnableDigitizer() returns false, then Rhino will not calibrate the digitizer.
Returns: true if the operation succeeded; otherwise, false.
GetLicense
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 bool GetLicense()
productBuildType,
The product build contentType required by your plug-in.
validateProductKeyDelegate,
Since the Rhino licensing system knows nothing about your product license, you will need to validate the product license provided by the Rhino licensing system. This is done by supplying a callback function, or delegate, that can be called to perform the validation.
leaseChangedDelegate
Called by the ZooClient when the cloud zoo lease is changed.
Returns: true if a valid license was found. false otherwise.
GetLicense
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 bool GetLicense()
licenseCapabilities,
In the event that a license was not found, or if the user wants to change the way your plug-in is licenses, then provide what capabilities your license has by using this enumeration flag.
textMask,
In the event that the user needs to be asked for a license, then you can provide a text mask, which helps the user to distinguish between proper and improper user input of your license code. Note, if you do not want to use a text mask, then pass in a null value for this parameter. For more information on text masks, search MSDN for the System.Windows.Forms.MaskedTextBox class.
validateProductKeyDelegate,
Since the Rhino licensing system knows nothing about your product license, you will need to validate the product license provided by the Rhino licensing system. This is done by supplying a callback function, or delegate, that can be called to perform the validation.
leaseChangedDelegate
Called by the ZooClient when the cloud zoo lease is changed.
Returns: true if a valid license was found. false otherwise.
GetLicenseOwner
Get the customer name and organization used when entering the product license.
GetPlugInObject
Icon
Returns the plug-in's icon in bitmap form.
Returns: The icon if successful, null otherwise.
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.
ObjectPropertiesPages
Override this function is you want to extend the object properties dialog
obsoleteUse ObjectPropertiesPages(ObjectPropertiesPageCollection collection) instead
ObjectPropertiesPages
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 virtual void ObjectPropertiesPages()
OnLoad
Is called when the plug-in is being loaded.
protected virtual LoadReturnCode OnLoad()
ref string
errorMessage
If a load error is returned and this string is set. This string is the error message that will be reported back to the user.
Returns: An appropriate load return code.
The default implementation returns LoadReturnCode.Success.
OnShutdown
protected virtual void OnShutdown()
OptionsDialogPages
Override this function if you want to extend the options dialog. This function is called whenever the user brings up the Options dialog.
protected virtual void OptionsDialogPages()
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 virtual void ReadDocument()
doc,
A Rhino document that is being loaded.
archive,
OpenNURBS file archive object Rhino is using to read this file. Use BinaryArchiveReader.Read*() functions to read plug-in data. If any BinaryArchive.Read*() functions throws an exception then archive.ReadErrorOccurve will be true and you should immediately return.
options
Describes what is being written.
ResetMessageBoxes
protected virtual void ResetMessageBoxes()
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.
SaveSettings
Write settings to disk which will raise a PlugIn.SettingsSaved event.
public void SaveSettings()
If the digitizer is enabled, call this function to send a point to Rhino. Call this function as much as you like. The digitizers that Rhino currently supports send a point every 15 milliseconds or so. This function should be called when users press or release any digitizer button.
public void SendPoint()
point,
3d point in digitizer coordinates.
mousebuttons,
corresponding digitizer button is down.
shiftKey,
true if the Shift keyboard key was pressed. Otherwise, false.
controlKey
true if the Control keyboard key was pressed. Otherwise, false.
If the digitizer is enabled, call this function to send a point and direction to Rhino. Call this function as much as you like. The digitizers that Rhino currently supports send a point every 15 milliseconds or so. This function should be called when users press or release any digitizer button.
public void SendRay()
ray,
3d ray in digitizer coordinates.
mousebuttons,
corresponding digitizer button is down.
shiftKey,
true if the Shift keyboard key was pressed. Otherwise, false.
controlKey
true if the Control keyboard key was pressed. Otherwise, false.
SetLicenseCapabilities
protected void SetLicenseCapabilities()
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().
protected virtual bool ShouldCallWriteDocument()
options
The file write options, such as "include preview image" and "include render meshes".
Returns: true if the plug-in wants to save document user data in the version 5 .3dm file. The default returns false.
WriteDocument
Called when Rhino is saving a .3dm file to allow the plug-in to save document user data.
protected virtual void WriteDocument()
doc,
The Rhino document instance that is being saved.
archive,
OpenNURBS file archive object Rhino is using to write the file. Use BinaryArchiveWriter.Write*() functions to write plug-in data. OR use the ArchivableDictionary If any BinaryArchiveWriter.Write*() functions throw an exception, then archive.WriteErrorOccured will be true and you should immediately return. Setting archive.WriteErrorOccured to true will cause Rhino to stop saving the file.
options
The file write options, such as "include preview image" and "include render meshes".
Events
SettingsSaved
This event is raised when an instance of Rhino has modified the external settings file associated with this plug-in's PlugIn.Settings property.
See Also: PlugIn.SaveSettings()