Skip to main content
⚠️ Archived Version

You are viewing documentation for Design Editor version 7.3, which is no longer actively maintained. For the latest features and updates, please refer to the current version (7.4).

Class: CommandManager

Performs operations on the product and its design elements.

Example​

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​

Constructors​

Constructor​

new CommandManager(postMessageClient): CommandManager

Parameters​

postMessageClient​

Client

Returns​

CommandManager

Methods​

execute()​

execute(name, args?, historyUpdateMode?): Promise<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<any>

Example​

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);
Was this page helpful?