# MPxCommand

## Base Class

None.

## Constants

Name | Type | Description
--- | --- | ---
Result Types
kLong | int |
kDouble | int |
kString | int |
kNoArg | int |

## Static Methods

Name | Parameters | Returns | Description
--- | --- | --- | ---
appendToResult(value) | value - bool, int, float, string, sequence of numerics or sequence of strings | None | Append a value to the result to be returned by the command.
clearResult() |  | None | Clears the command's result.
currentResult() |  | bool, int, float, string, or a list of ints, floats or strings | Returns the command's current result.
currentResultType |  | Result Type constant | Returns the type of the current result.
displayError(msg, showLineNumbers=False) | msg - string showLineNumbers - bool | None | Display an error message.
displayInfo(msg, showLineNumbers=False) | msg - string showLineNumbers - bool | None | Display an informational message.
displayWarning(msg, showLineNumbers=False) | msg - string showLineNumbers - bool | None | Display a warning message.
isCurrentResultArray() |  | bool | Returns True if the command's current result is an array of values.
setResult(value) | value - bool, int, float, string, sequence of numerics or sequence of strings | None | Set the value of the result to be returned by the command.

## Constructors

Signature | Parameters | Description
--- | --- | ---
MPxCommand() |  | Default constructor. Returns a new, empty MPxCommand object.

## Virtual Methods

These are methods which are called by Maya and can be overridden in the derived class to change Maya's behaviour.

Signature | Parameters | Returns | Description
--- | --- | --- | ---
doIt(args) | args - MArgList | None | Called by Maya to execute the command.
hasSyntax() |  | bool | Called by Maya to determine if the command provides an MSyntax object describing its syntax.
isUndoable() |  | bool | Called by Maya to determine if the command supports undo.
redoIt() |  | None | Called by Maya to redo a previously undone command.
undoIt() |  | None | Called by Maya to undo a previously executed command.

## Object Methods

Signature | Parameters | Returns | Description
--- | --- | --- | ---
syntax() |  | MSyntax | Returns the command's MSyntax object, if it has one.

## Object Attributes

Name | Type | Access | Description
--- | --- | --- | ---
historyOn | bool | RW | Determines if construction history is on for the command.
commandString | string | RW | Command string to be echoed to the user.

## Sequence Support

None.

## Number Support

None.

## Comparison Support

None.

© 2011 Autodesk, Inc. All rights reserved.