Command
Defines a base class for all commands. This class is abstract.
Inheritance Hierarchy
System.Object
Rhino.Commands.Command
Rhino.Commands.SelCommand
Rhino.Commands.TransformCommand
Namespace: Rhino.Commands
Assembly: RhinoCommon (in RhinoCommon.dll)
Syntax
public abstract class Command
The Command type exposes the following members.
Constructors
Name
Description
Protected Method
Command
Default protected constructor. It only allows instantiation through sub-classing.
Properties
Name
Description
Protected property
CommandContextHelpUrl
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 Property
EnglishName
Gets the name of the command. This method is abstract.
Public Property
Id
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 Property
Static Member
LastCommandId
Gets the ID of the last commands.
Public Property
Static Member
LastCommandResult
Gets the result code of the last command.
Public Property
LocalName
Gets the local name of the command.
Public Property
PlugIn
Gets the plug-in where this commands is placed.
Public Property
Settings
Gets the settings of the command.
Methods
Name
Description
Public Method
Static Member
DisplayHelp
Displays help for a command.
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
GetCommandNames
Gets list of command names in Rhino. This list does not include Test, Alpha, or System commands.
Public Method
Static Member
GetCommandStack
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 Method
GetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public Method
Static Member
GetMostRecentCommands
Gets an array of most recent command descriptions.
Public Method
GetType
Gets the Type of the current instance.
(Inherited from Object.)
Public Method
Static Member
InCommand
Determines if Rhino is currently running a command.
Public Method
Static Member
InScriptRunnerCommand
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 Method
Static Member
IsCommand
Determines is a string is a command.
Public Method
Static Member
IsValidCommandName
Determines if a string is a valid command name.
Public Method
Static Member
LookupCommandId
Returns the ID of a command.
Public Method
Static Member
LookupCommandName
Returns the command name given a command ID.
Protected Method
MemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Protected Method
OnHelp
Is called when the user needs assistance with this command.
Protected Method
ReplayHistory
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 Method
RunCommand
Executes the command.
Public Method
Static Member
RunProxyCommand
Execute some code as if it were running in a command
Public Method
ToString
Returns a string that represents the current object.
(Inherited from Object.)
Events
Name
Description
Public Event
Static Member
BeginCommand
Called just before command.RunCommand().
Public Event
Static Member
EndCommand
Called immediately after command.RunCommand().
Public Event
Static Member
UndoRedo
Used to monitor Rhino’s built in undo/redo support.