Skip to content

Tool

Information about a SketchUp tool — its name and numeric ID.

You receive Tool objects as part of a ToolState from model.tools.getActive() or inside a model.tools.observeToolChanges() callback. Each tool has a stable numeric ID assigned by SketchUp — for example, the Rectangle tool is always 21094.

let model = await SketchUpApi.getActiveModel();
// Watch for tool activations
model.tools.observeToolChanges(change => {
if (change.event === 'Activation') {
console.log(change.tool.name);
// => 'PaintTool', 'RectangleTool', etc.
console.log(change.tool.id);
}
});
  • ToolState
  • SketchupTools.getActive
  • SketchupTools.observeToolChanges

SDK 1.19.0 protocol 1.16.0

readonly id: number

A predefined numeric identifier unique to this tool. For example, the Rectangle tool is 21094.


readonly name: string

The display name of this tool, like 'PaintTool'.