Properties
Returns true when Rhino is allowed to save, false otherwise Conditions where Rhino is not allowed to save are: when evaluation licenses are expired; when a Cloud Zoo lease is expired; when a license is shared by a single user on multiple computers, and the current computer is not active.
Returns true if Rhino will validate each object added to the document. This can be time consuming but is valuable for debugging.
Text in Rhino's command history window.
Provides a TextWriter that can write to the command line.
Enable or disable capturing of the strings sent to the CommandWindow through Write and WriteLine calls
Returns number of days until license expires. Zero when license is expired. Raises InvalidLicenseTypeException if LicenseExpires would return false.
Default font used to render user interface
Service release version of Rhino executable (0, 1, 2, ...) The integer is the service release number of Rhino. For example, this function returns "0" if Rhino V4SR0 is running and returns "1" if Rhino V4SR1 is running.
Major version of Rhino executable 4, 5, ...
Gets the product installation type, as seen in Rhino's ABOUT dialog box.
Gets the type of installation (product edition) of the license or lease.
Returns true if we are currently not running on the main user interface thread
Returns true if Rhino is in the process of closing, false otherwise. This can be true even before the Closing event fires, such as when RhinoDoc.CloseDocument event is called.
Returns true if rhino is currently using the Cloud Zoo false otherwise
Returns true if Rhino is licensed as an Evaluation product false otherwise
Returns true if Rhino is in the process of exiting, false otherwise. This can be true even before the Closing event fires, such as when RhinoDoc.CloseDocument event is called.
Returns true when Rhino is allowed to access the Internet, false otherwise. Note, this does not test if Internet access is available.
Returns true if the license is validated false otherwise
Is the current thread the main thread
Returns true if Rhino's parent window is the desktop, false otherwise.
Remarks: The parent of a top-level window is the desktop window. Some applications like to re-parent Rhino's main window to a window they provide. Use this property to determine if Rhino is in such a condition. Note, this property is only valid on Windows.
Returns true if Rhino is compiled as pre-release build (Beta, WIP) false otherwise
Is Rhino currently being executed through automation
Is Rhino currently being executed as a batch run, either started with the /batchmode command line switch or put into batch mode since by the BatchMode command. A batch run has a main window but no user: commands take their input from the command line rather than showing dialogs, and modal message boxes are written to the command line instead of being shown.
Remarks: To decide whether it is safe to show blocking user interface, test IsRunningUnattended instead - it also covers headless.
Is Rhino currently being executed in headless mode
Is Rhino running with no user available to answer a question. True when either IsRunningHeadless or IsRunningBatchMode is true.
Remarks: Test this before showing any modal dialog. When it is true there is nobody to dismiss the dialog, so it will block until the process is killed. Write to the command line instead.
IsRunningAutomated is deliberately excluded. COM automation clients have driven a fully interactive Rhino since V4 and keep that behaviour unchanged; a caller that wants the unattended behaviour starts Rhino with /batchmode.
Is Rhino being executed in safe mode
Is Rhino currently using custom, user-interface Skin.
Returns true if the license will expire false otherwise
Gets the name of the user that owns the license or lease.
Gets the name of the organization of the user that owns the license or lease.
Returns the logged in user's avatar picture. Returns a default avatar if the user does not have an avatar or if the avatar could not be fetched.
Returns the name of the logged in user, or null if the user is not logged in.
[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
public static RhinoWindow MainApplicationWindow { get; }
obsoleteUse MainWindowHandle or RhinoEtoApp.MainWindow in Rhino.UI
Same as MainWindow function, but provides the concrete class instead of an interface
Rhino SDK 9 digit SDK service release number in the form YYYYMMDDn Service release of the Rhino SDK supported by this executable. Rhino will only load plug-ins that require a service release of <= this release number. For example, SR1 will load all plug-ins made with any SDK released up through and including the SR1 SDK. But, SR1 will not load a plug-in built using the SR2 SDK. If an "old" Rhino tries to load a "new" plug-in, the user is told that they have to get a free Rhino.exe update in order for the plug-in to load. Rhino.exe updates are available from http://www.rhino3d.com.
Rhino SDK 9 digit SDK version number in the form YYYYMMDDn Rhino will only load plug-ins that were build with exactly the same version of the SDK.
Enable or disable sending command window strings to the console RhinoApp.Write(...) calls would be sent to the console when this is enabled
Gets the product serial number, as seen in Rhino's ABOUT dialog box.
Collection of currently open toolbar files in the application
Returns true when Rhino is allowed to access the Internet, false otherwise. Note, this does not test if Internet access is available.
Returns true if the user is logged in; else returns false. A logged in user does not guarantee that the auth tokens managed by the CloudZooManager instance are valid.
Returns number of days within which validation must occur. Zero when validation grace period has expired. Raises InvalidLicenseTypeException if LicenseType is one of: EvaluationSaveLimited EvaluationTimeLimited Viewer Unknown
Methods
Display UI asking the user to enter a license for Rhino or use one from the Zoo.
Get list of strings sent to the command window through calls to Write or WriteLine when capturing has been enabled
Parameters:
| clearBuffer (bool) | Clear the captured buffer after this call |
Returns: array of captured strings
Display UI asking the user to enter a license for the product specified by licenseId.
Parameters:
| pluginId (Guid) | Guid identifying the plug-in that is requesting a change of license key |
Returns: true on success, false otherwise
public static void ClearCommandHistoryWindow()
Clear the text in Rhino's command history window.
Execute a Rhino command.
Exit
#Exits, or forcefully closes Rhino. A prompt to allow saving will appear if necessary when forcefully exiting Works on Windows and MacOS true to allow the user to cancel exiting false to force exit
Parameters:
| allowCancel (bool) |
public static string GetDataDirectory(bool localUser, bool forceDirectoryCreation, string subDirectory)
Gets the data directory.
Parameters:
| localUser (bool) | If set to true local user. |
| forceDirectoryCreation (bool) | If set to true force directory creation. |
| subDirectory (string) | Sub directory, will get appended to the end of the data directory. if forceDirectoryCreation is true then this directory will get created and writable. |
Returns: The data directory.
Gets the data directory.
Directory where main RhinoCore binary is located
Directory where all of Rhino is installed
Gets the object that is returned by PlugIn.GetPlugInObject for a given plug-in. This function attempts to find and load a plug-in with a given Id. When a plug-in is found, it's GetPlugInObject function is called and the result is returned here. Note the plug-in must have already been installed in Rhino or the plug-in manager will not know where to look for a plug-in with a matching id.
Parameters:
| pluginId (Guid) | Guid for a given plug-in. |
Returns: Result of PlugIn.GetPlugInObject for a given plug-in on success.
Gets the object that is returned by PlugIn.GetPlugInObject for a given plug-in. This function attempts to find and load a plug-in with a given name. When a plug-in is found, it's GetPlugInObject function is called and the result is returned here. Note the plug-in must have already been installed in Rhino or the plug-in manager will not know where to look for a plug-in with a matching name.
Parameters:
| plugin (string) | Name of a plug-in. |
Returns: Result of PlugIn.GetPlugInObject for a given plug-in on success.
Verifies that Rhino is running in full screen mode.
Returns: true if Rhino is running full screen, false otherwise.
Work-In-Progress. Testing this with our unit test framework
Parameters:
| action (Action) |
Execute a function on the main UI thread.
If licenseType is a beta license, returns true. A beta license grants full use of the product during the pre-release development period.
Parameters:
| licenseType (Installation) |
Returns: true if licenseType is a beta license. false otherwise
If licenseType is a commercial license, returns true. A commercial license grants full use of the product.
Parameters:
| licenseType (Installation) |
Returns: true if licenseType is a commercial license. false otherwise
If licenseType is an evaluation license, returns true. An evaluation license limits the ability of Rhino to save based on either the number of saves or a fixed period of time.
Parameters:
| licenseType (Installation) |
Returns: true if licenseType is an evaluation license. false otherwise
[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
public static IWin32Window MainWindow()
obsoleteUse MainWindowHandle or RhinoEtoApp.MainWindow in Rhino.UI
Main Rhino Window
public static nint MainWindowHandle()
Gets the HWND of the Rhino main window.
Print a string to the Visual Studio Output window, if a debugger is attached. Note that the developer needs to add a newline manually if the next output should come on a separate line.
Parameters:
| str (string) | The string to print to the Output window. |
public static string ParseTextField(string formula, RhinoObject obj, RhinoObject topParentObject, InstanceObject immediateParent)
Parses a text field string.
Parameters:
| formula (string) | The text formula. |
| obj (RhinoObject) | The Rhino object. Value can be IntPtr.Zero. |
| topParentObject (RhinoObject) | The parent Rhino object. Value can be IntPtr.Zero. |
| immediateParent (InstanceObject) | The immediate parent instance object. Value can be IntPtr.Zero. |
Returns: The parsed text field if sucessful.
Parses a text field string.
Parameters:
| formula (string) | The text formula. |
| obj (RhinoObject) | The Rhino object. Value can be IntPtr.Zero. |
| topParentObject (RhinoObject) | The parent Rhino object. Value can be IntPtr.Zero. |
Returns: The parsed text field if sucessful.
Post a cancel event to the command line
Parameters:
| runtimeDocSerialNumber (uint) | Unique serialNumber for the document to post the event to. |
[CLSCompliant(false)]
public static void PostEnterEvent(uint runtimeDocSerialNumber, bool bRepeatedEnter)
Post an enter event to the command line
Refresh the license used by Rhino. This allows any part of Rhino to ensure that the most current version of the license file on disk is in use.
Find out if Rhino is running in a remote session
Returns: true if Rhino is running in a RDP session, false otherwise
Verifies that Rhino is running on VMWare
Returns: true if Rhino is running in Windows on VMWare, false otherwise
Runs a Rhino command script.
Remarks: Rhino acts as if each character in the script string had been typed in the command prompt. When RunScript is called from a "script runner" command, it completely runs the script before returning. When RunScript is called outside of a command, it returns and the script is run. This way menus and buttons can use RunScript to execute complicated functions.
Parameters:
| script (string) | [in] script to run. |
| echo (bool) | Controls how the script is echoed in the command output window. false = silent - nothing is echoed. true = verbatim - the script is echoed literally. |
Exceptions:
| ApplicationException | If RunScript is being called while inside an event watcher. |
Runs a Rhino command script.
Remarks: Rhino acts as if each character in the script string had been typed in the command prompt. When RunScript is called from a "script runner" command, it completely runs the script before returning. When RunScript is called outside of a command, it returns and the script is run. This way menus and buttons can use RunScript to execute complicated functions.
Parameters:
| script (string) | [in] script to run. |
| mruDisplayString (string) | [in] String to display in the most recent command list. |
| echo (bool) | Controls how the script is echoed in the command output window. false = silent - nothing is echoed. true = verbatim - the script is echoed literally. |
Exceptions:
| ApplicationException | If RunScript is being called while inside an event watcher. |
[CLSCompliant(false)]
public static bool RunScript(uint documentSerialNumber, string script, bool echo)
Runs a Rhino command script.
Remarks: Rhino acts as if each character in the script string had been typed in the command prompt. When RunScript is called from a "script runner" command, it completely runs the script before returning. When RunScript is called outside of a command, it returns and the script is run. This way menus and buttons can use RunScript to execute complicated functions.
Parameters:
| documentSerialNumber (uint) | [in] Document serial number for the document to run the script for. |
| script (string) | [in] script to run. |
| echo (bool) | [in] Controls how the script is echoed in the command output window. false = silent - nothing is echoed. true = verbatim - the script is echoed literally. |
Exceptions:
| ApplicationException | If RunScript is being called while inside an event watcher. |
[CLSCompliant(false)]
public static bool RunScript(uint documentSerialNumber, string script, string mruDisplayString, bool echo)
Runs a Rhino command script.
Remarks: Rhino acts as if each character in the script string had been typed in the command prompt. When RunScript is called from a "script runner" command, it completely runs the script before returning. When RunScript is called outside of a command, it returns and the script is run. This way menus and buttons can use RunScript to execute complicated functions.
Parameters:
| documentSerialNumber (uint) | [in] Document serial number for the document to run the script for. |
| script (string) | [in] script to run. |
| mruDisplayString (string) | [in] String to display in the most recent command list. |
| echo (bool) | [in] Controls how the script is echoed in the command output window. false = silent - nothing is echoed. true = verbatim - the script is echoed literally. |
Exceptions:
| ApplicationException | If RunScript is being called while inside an event watcher. |
Sends a string of printable characters, including spaces, to Rhino's command line.
Sets the command prompt in Rhino.
Set Rhino command prompt.
Parameters:
| prompt (string) | The new prompt text. |
Set the text that appears in the Rhino command prompt. In general, you should use the SetCommandPrompt functions. In rare cases, like worker thread messages, the message that appears in the prompt has non-standard formatting. In these rare cases, SetCommandPromptMessage can be used to literally specify the text that appears in the command prompt window.
Parameters:
| prompt (string) | A literal text for the command prompt window. |
public static void SetFocusToMainWindow()
Sets the focus to the main window. This function attempts to use the ActiveDoc on Mac to figure out which window to set focus to.
Sets the focus to the main windows for a given document
Parameters:
| doc (RhinoDoc) | the document to use for determining a "main window" |
Validates a stand-alone Rhino license key for the given Rhino account email against the McNeel validation server, without asking the user for any input. Shows the validation wizard's connection/validation progress steps; problems reported by the server route to the wizard's normal interactive steps. On success the license is locked to this computer (standalone node). Used by the rhinoN://license protocol handler to install a license from a web link.
Print formatted text in the command window.
Print formatted text in the command window.
Print formatted text in the command window.
Print formatted text in the command window.
Parameters:
| message (string) |
Print formatted text with a newline in the command window.
Print formatted text with a newline in the command window.
Print formatted text with a newline in the command window.
Events
Is raised when settings are changed.
Is raised when the application is about to close.
CommandPromptChanged
#Fired when the command line changes
Can add or removed delegates that are raised when the escape key is clicked.
Occurs when the application finishes processing and is about to enter the idle state
Is raised when the application is fully initialized.
Can add or removed delegates that are raised by a keyboard event.
Fires when the license state has changed
Gets called every loop iteration inside Rhino's main message loop.
Monitors when the RDK thumbnail cache images are changed.
Monitors when RDK global settings are modified.
Monitors when RDK document information is rebuilt.
Monitors when RDK client plug-ins are unloaded.
Monitors when RDK thumbnails are updated.
Monitors when Rhino's current renderer changes.