ToolState
The active tool and its current state code.
Retrieve the active tool with model.tools.getActive(), or
subscribe to changes with model.tools.observeToolChanges().
The state number is tool-specific — its meaning varies per
tool and is not consistent across the SketchUp toolset.
Example
Section titled “Example”let model = await SketchUpApi.getActiveModel();
// React to tool state changesmodel.tools.observeToolChanges(change => { if (change.event === 'StateChange') { console.log(change.state.tool.name); console.log(change.state.state); }});- Tool
- SketchupTools.getActive
- SketchupTools.observeToolChanges
SDK 1.19.0 protocol 1.16.0
Properties
Section titled “Properties”
readonlystate:number
A numeric code representing the tool’s current state. The meaning varies per tool and is not standardized.
readonlytool:Tool
The tool that is currently active.
Methods
Section titled “Methods”toString()
Section titled “toString()”toString():
string
Returns
Section titled “Returns”string