executeCommand Method

Description

Executes an editor command.

Syntax

.executeCommand(/*String*/ commandName, [parameters])

Parameters

commandName: String

The name of the command to be executed. This must be a valid command name. More information on editor commands is available here.

[parameters]

Some command have parameters. Information on the parameters for editor commands is available here.

Example

// Enable the grid.
editor.executeCommand('enableGrid', true);

...

// Start a line drawing operation.
editor.executeCommand('draw_line');