- Main Page
- Related Pages
- Modules
- Classes
- Examples

- Class List
- Class Hierarchy
- Class Members

Public Types | Public Member Functions | Static Public Member Functions

# MCommandResult Class Reference

# OpenMaya - API module for common classes

Search for all occurrences

## Detailed Description

Result returned from executing a command.

MCommandResult collects the result returned by MGlobal::executeCommand. It can either be an int or an array of int or a double or an array of double or a string or an array of string. Use resultType to find out its type and use the appropriate getResult method to retrieve the result.

`#include <MCommandResult.h>`

List of all members.

## Public Types
enum | Type { kInvalid = 0, kInt, kIntArray, kDouble, kDoubleArray, kString, kStringArray, kVector, kVectorArray, kMatrix, kMatrixArray }
| The types of results that MEL commands can return. More...
## Public Member Functions
| MCommandResult (MStatus *ReturnStatus=NULL)
| Constructor for MCommandResult.
virtual | ~MCommandResult ()
| Destructor for MCommandResult.
Type | resultType (MStatus *ReturnStatus=NULL) const
| Returns the type of the result.
MStatus | getResult (int &result) const
| Retrieves the command result which is an int.
MStatus | getResult (MIntArray &result) const
| Retrieves the command result which is an int array.
MStatus | getResult (double &result) const
| Retrieves the command result which is a double.
MStatus | getResult (MDoubleArray &result) const
| Retrieves the command result which is a double array.
MString | stringResult (MStatus *ReturnResult=NULL) const
| Retrieves the command result which is a string.
MStatus | getResult (MString &result) const
| NO SCRIPT SUPPORT.
MStatus | getResult (MStringArray &result) const
| Retrieves the command result which is a string array.
MStatus | getResult (MVector &result) const
| Retrieves the command result which is a vector.
MStatus | getResult (MVectorArray &result) const
| Retrieves the command result which is a vector array.
MStatus | getResult (MDoubleArray &result, int &numRows, int &numColumns) const
| Retrieves the command result which is a matrix.
## Static Public Member Functions
static const char * | className ()
| Returns the name of this class.

## Member Enumeration Documentation

enum Type

Search for all occurrences

The types of results that MEL commands can return.

Enumerator:

  kInvalid | Search for all occurrences
  kInt | Search for all occurrences
  kIntArray | Search for all occurrences
  kDouble | Search for all occurrences
  kDoubleArray | Search for all occurrences
  kString | Search for all occurrences
  kStringArray | Search for all occurrences
  kVector | Search for all occurrences
  kVectorArray | Search for all occurrences
  kMatrix | Search for all occurrences
  kMatrixArray | Search for all occurrences

## Constructor & Destructor Documentation

MCommandResult | ( | MStatus * | ReturnStatus = `NULL` | ) |

Constructor for MCommandResult.

Parameters:

  [out] | ReturnStatus | Status code

## Member Function Documentation

MCommandResult::Type resultType | ( | MStatus * | ReturnStatus = `NULL` | ) | const

Search for all occurrences

Returns the type of the result.

Parameters:

  [out] | ReturnStatus | Status code

Returns:
  - MCommandResult::kInt
  - MCommandResult::kIntArray
  - MCommandResult::kDouble
  - MCommandResult::kDoubleArray
  - MCommandResult::kString
  - MCommandResult::kStringArray
  - MCommandResult::kVector
  - MCommandResult::kVectorArray
  - MCommandResult::kMatrix
  - MCommandResult::kInvalid

MStatus getResult | ( | int & | result | ) | const

Search for all occurrences

Retrieves the command result which is an int.

Parameters:

  [out] | result | Storage for the command result

Returns:
  Status Code

Status Codes:
  - MS::kSuccess
  - MS::kFailure

MStatus getResult | ( | MIntArray & | result | ) | const

Search for all occurrences

Retrieves the command result which is an int array.

Parameters:

  [out] | result | Storage for the command result

Returns:
  Status Code

Status Codes:
  - MS::kSuccess
  - MS::kFailure

MStatus getResult | ( | double & | result | ) | const

Search for all occurrences

Retrieves the command result which is a double.

Parameters:

  [out] | result | Storage for the command result

Returns:
  Status Code

Status Codes:
  - MS::kSuccess
  - MS::kFailure

MStatus getResult | ( | MDoubleArray & | result | ) | const

Search for all occurrences

Retrieves the command result which is a double array.

Parameters:

  [out] | result | Storage for the command result

Returns:
  Status Code

Status Codes:
  - MS::kSuccess
  - MS::kFailure

MString stringResult | ( | MStatus * | ReturnStatus = `NULL` | ) | const

Search for all occurrences

Retrieves the command result which is a string.

Parameters:

  [out] | ReturnStatus | Optional status code. See below.

Returns:
  The command result

Status Codes:
  - MS::kSuccess
  - MS::kFailure

MStatus getResult | ( | MString & | result | ) | const

Search for all occurrences

NO SCRIPT SUPPORT.

Retrieves the command result which is a string.

Python Notes

This method is not supported in Python. See the stringResult function which returns a string.

Parameters:

  [out] | result | Storage for the command result

Returns:
  Status Code

Status Codes:
  - MS::kSuccess
  - MS::kFailure

MStatus getResult | ( | MStringArray & | result | ) | const

Search for all occurrences

Retrieves the command result which is a string array.

Parameters:

  [out] | result | Storage for the command result

Returns:
  Status Code

Status Codes:
  - MS::kSuccess
  - MS::kFailure

MStatus getResult | ( | MVector & | result | ) | const

Search for all occurrences

Retrieves the command result which is a vector.

Parameters:

  [out] | result | Storage for the command result

Returns:
  Status Code

Status Codes:
  - MS::kSuccess
  - MS::kFailure

MStatus getResult | ( | MVectorArray & | result | ) | const

Search for all occurrences

Retrieves the command result which is a vector array.

Parameters:

  [out] | result | Storage for the command result

Returns:
  Status Code

Status Codes:
  - MS::kSuccess
  - MS::kFailure

MStatus getResult | ( | MDoubleArray & | result,
|  | int & | numRows,
|  | int & | numColumns
| ) |  | const

Search for all occurrences

Retrieves the command result which is a matrix.

Parameters:

  [out] | result | Storage for the content of the matrix (row-based)
  [out] | numRows | The number of rows in the matrix
  [out] | numColumns | The number of columns in the matrix

Returns:
  Status Code

Status Codes:
  - MS::kSuccess
  - MS::kFailure

const char * className | ( |  | ) | `[static]`

Search for all occurrences

Returns the name of this class.

Returns:
  Name of this class.

MCommandResult MCommandResult MCommandResult MCommandResult MCommandResult MCommandResult MCommandResult MCommandResult MCommandResult MCommandResult
MCommandResult MCommandResult MCommandResult MCommandResult MCommandResult MCommandResult MCommandResult MCommandResult MCommandResult MCommandResult