# Command class

Namespace: [Rhino.Commands](https://developer.rhino3d.com/api/rhinocommon/namespace/rhino.commands.md) · Assembly: [RhinoCommon](https://developer.rhino3d.com/api/rhinocommon/assembly/rhinocommon.md)

```cs
public abstract class Command
```

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

**Derived types:** [SelCommand](https://developer.rhino3d.com/api/rhinocommon/type/rhino.commands.selcommand.md), [TransformCommand](https://developer.rhino3d.com/api/rhinocommon/type/rhino.commands.transformcommand.md)

## Constructors

- [Command](https://developer.rhino3d.com/api/rhinocommon/type/rhino.commands.command/ctor.md): Default protected constructor. It only allows instantiation through sub-classing.

## Properties

- [CommandContextHelpUrl](https://developer.rhino3d.com/api/rhinocommon/type/rhino.commands.command/commandcontexthelpurl.md): 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.
- [EnglishName](https://developer.rhino3d.com/api/rhinocommon/type/rhino.commands.command/englishname.md): Gets the name of the command. This method is abstract.
- [HistoryReplayOnObjectAttributeChange](https://developer.rhino3d.com/api/rhinocommon/type/rhino.commands.command/historyreplayonobjectattributechange.md): By default, object attribute changes do not trigger history replay. Set this property to true, typically in the command's constructor, if you want objects created with this command to trigger history replay when their attributes change.
- [Id](https://developer.rhino3d.com/api/rhinocommon/type/rhino.commands.command/id.md): 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](https://learn.microsoft.com/dotnet/api/system.runtime.interopservices.guidattribute)
- [LastCommandId](https://developer.rhino3d.com/api/rhinocommon/type/rhino.commands.command/lastcommandid.md): (static) Gets the ID of the last commands.
- [LastCommandResult](https://developer.rhino3d.com/api/rhinocommon/type/rhino.commands.command/lastcommandresult.md): (static) Gets the result code of the last command.
- [LocalName](https://developer.rhino3d.com/api/rhinocommon/type/rhino.commands.command/localname.md): Gets the local name of the command.
- [PlugIn](https://developer.rhino3d.com/api/rhinocommon/type/rhino.commands.command/plugin.md): Gets the plug-in where this commands is placed.
- [Settings](https://developer.rhino3d.com/api/rhinocommon/type/rhino.commands.command/settings.md): Gets the settings of the command.

## Methods

- [DisplayHelp](https://developer.rhino3d.com/api/rhinocommon/type/rhino.commands.command/displayhelp.md): (static) Displays help for a command.
- [GetCommandContextHelpUrl](https://developer.rhino3d.com/api/rhinocommon/type/rhino.commands.command/getcommandcontexthelpurl.md): (static) Returns a command's context help url.
- [GetCommandNames](https://developer.rhino3d.com/api/rhinocommon/type/rhino.commands.command/getcommandnames.md): (static) Gets list of command names in Rhino. This list does not include Test, Alpha, or System commands.
- [GetCommandStack](https://developer.rhino3d.com/api/rhinocommon/type/rhino.commands.command/getcommandstack.md): (static) 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.
- [GetCommandStyle](https://developer.rhino3d.com/api/rhinocommon/type/rhino.commands.command/getcommandstyle.md): (static) Returns a command's style flags.
- [GetMostRecentCommands](https://developer.rhino3d.com/api/rhinocommon/type/rhino.commands.command/getmostrecentcommands.md): (static) Gets an array of most recent command descriptions.
- [InCommand](https://developer.rhino3d.com/api/rhinocommon/type/rhino.commands.command/incommand.md): (static) Determines if Rhino is currently running a command.
- [InScriptRunnerCommand](https://developer.rhino3d.com/api/rhinocommon/type/rhino.commands.command/inscriptrunnercommand.md): (static) 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".
- [IsCommand](https://developer.rhino3d.com/api/rhinocommon/type/rhino.commands.command/iscommand.md): (static) Determines is a string is a command.
- [IsValidCommandName](https://developer.rhino3d.com/api/rhinocommon/type/rhino.commands.command/isvalidcommandname.md): (static) Determines if a string is a valid command name.
- [LookupCommandId](https://developer.rhino3d.com/api/rhinocommon/type/rhino.commands.command/lookupcommandid.md): (static) Returns the ID of a command.
- [LookupCommandName](https://developer.rhino3d.com/api/rhinocommon/type/rhino.commands.command/lookupcommandname.md): (static) Returns the command name given a command ID.
- [OnHelp](https://developer.rhino3d.com/api/rhinocommon/type/rhino.commands.command/onhelp.md): Is called when the user needs assistance with this command.
- [ReplayHistory](https://developer.rhino3d.com/api/rhinocommon/type/rhino.commands.command/replayhistory.md): 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.
- [RunCommand](https://developer.rhino3d.com/api/rhinocommon/type/rhino.commands.command/runcommand.md): Executes the command.
- [RunProxyCommand](https://developer.rhino3d.com/api/rhinocommon/type/rhino.commands.command/runproxycommand.md): (static) Execute some code as if it were running in a command

## Events

- [BeginCommand](https://developer.rhino3d.com/api/rhinocommon/type/rhino.commands.command/begincommand.md): (static) Called just before command.RunCommand().
- [EndCommand](https://developer.rhino3d.com/api/rhinocommon/type/rhino.commands.command/endcommand.md): (static) Called immediately after command.RunCommand().
- [UndoRedo](https://developer.rhino3d.com/api/rhinocommon/type/rhino.commands.command/undoredo.md): (static) Used to monitor Rhino's built in undo/redo support.
