Click or drag to resize

Command Class

Defines a base class for all commands. This class is abstract.
Inheritance Hierarchy

Namespace:  Rhino.Commands
Assembly:  RhinoCommon (in RhinoCommon.dll)
public abstract class Command

The Command type exposes the following members.

Protected methodCommand
Default protected constructor. It only allows instantiation through subclassing.
Protected propertyCommandContextHelpUrl
Gets the URL of the command contextual help. This is usually a location of a local CHM file.

The default implementation return an empty string.

Public propertyEnglishName
Gets the name of the command. This method is abstract.
Public propertyId
Gets the unique ID of this command. It is best to use a Guid attribute for each custom derived command class since this will keep the id consistent between sessions of Rhino GuidAttribute
Public propertyStatic memberLastCommandId
Gets the ID of the last commands.
Public propertyStatic memberLastCommandResult
Gets the result code of the last command.
Public propertyLocalName
Gets the local name of the command.
Public propertyPlugIn
Gets the plug-in where this commands is placed.
Public propertySettings
Gets the settings of the command.
Public methodStatic memberDisplayHelp
Displays help for a command.
Public methodEquals (Inherited from Object.)
Protected methodFinalize (Inherited from Object.)
Public methodStatic memberGetCommandNames
Gets list of command names in Rhino. This list does not include Test, Alpha, or System commands.
Public methodStatic memberGetCommandStack
Determines if Rhino is currently running a command. Because Rhino allow for transparent commands (commands that can be run from inside of other commands), this method returns the total ids of active commands.
Public methodGetHashCode (Inherited from Object.)
Public methodStatic memberGetMostRecentCommands
Gets an array of most recent command descriptions.
Public methodGetType (Inherited from Object.)
Public methodStatic memberInCommand
Determines if Rhino is currently running a command.
Public methodStatic memberInScriptRunnerCommand
This is a low level tool to determine if Rhino is currently running a script running command like "ReadCommandFile" or the RhinoScript plug-in's "RunScript".
Public methodStatic memberIsCommand
Determines is a string is a command.
Public methodStatic memberIsValidCommandName
Determines if a string is a valid command name.
Public methodStatic memberLookupCommandId
Returns the ID of a command.
Public methodStatic memberLookupCommandName
Returns the command name given a command ID.
Protected methodMemberwiseClone (Inherited from Object.)
Protected methodOnHelp
Is called when the user needs assistance with this command.
Protected methodReplayHistory
Repeats an operation of a command.

In order to make this function work, you will likely need to grab the Result property that gives the list of input objects. Then, you will be able to replace these inputs by using one of the UpdateToX() methods of the ReplayHistoryResult.

You should NOT use any document AddX() or ReplaceX() functions, as they will break history.

Protected methodRunCommand
Executes the command.
Public methodToString (Inherited from Object.)
Public eventStatic memberBeginCommand
Called just before command.RunCommand().
Public eventStatic memberEndCommand
Called immediately after command.RunCommand().
Public eventStatic memberUndoRedo
Used to monitor Rhino's built in undo/redo support.
Version Information

Rhino for Mac

Supported in: 5.4

Rhino for Windows

Supported in: 6.2
See Also