---
title: "Class: CommandManager | Customer's Canvas On-Premises"
canonical: "https://customerscanvas.com/docs/on-premises/design-editor/iframe-api/reference/design-editor-iframe/classes/CommandManager.CommandManager/"
---

# Class: CommandManager

> Performs operations on the product and its design elements.

## Example

``` js
const ids = (await editor.getSelectedItems()).map(item => item.id);

const args = {
    translateX: 108,
    translateY: 0,
    itemIds: ids
};

// Moves the selected items 1.5 inches horizontally.
editor.commandManager.execute("translateItems", args);
```

## Implements

- [`Json`](https://customerscanvas.com/docs/on-premises/design-editor/iframe-api/reference/design-editor-iframe/variables/LegacyIframeApi.CustomersCanvas.Utils.Json.md)

## Constructors

### Constructor

> **new CommandManager**(`postMessageClient`): `CommandManager`

#### Parameters

##### postMessageClient

[`Client`](https://customerscanvas.com/docs/on-premises/design-editor/iframe-api/reference/design-editor-iframe/classes/Client.Client.md)

#### Returns

`CommandManager`

## Methods

### execute()

> **execute**(`name`, `args?`, `historyUpdateMode?`): [`Promise`](https://customerscanvas.com/docs/on-premises/design-editor/iframe-api/reference/design-editor-iframe/interfaces/finally.Promise.md)\<`any`\>

Executes the Translate and Resize operations.

#### Parameters

##### name

`any`

The name of the operation, for example, `"translateItems"` or `"resize"`.

##### args?

`any`

An object defining arguments of the operation. The current implementation supports `IExternalResizeArgs` and `IExternalTranslateItemCommandArgs`.

##### historyUpdateMode?

`HistoryUpdateMode`

Defines how the history of user actions should be updated, one of `NotUpdate`, `Update` (by default), or `ForceUpdate`.

#### Returns

[`Promise`](https://customerscanvas.com/docs/on-premises/design-editor/iframe-api/reference/design-editor-iframe/interfaces/finally.Promise.md)\<`any`\>

#### Example

``` js
const ids = (await editor.getSelectedItems()).map(item => item.id);

const args = {
    translateX: 108,
    translateY: 0,
    itemIds: ids
};

// Moves the selected items 1.5 inches horizontally.
editor.commandManager.execute("translateItems", args);
```
