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.
Example
Section titled “Example”let model = await SketchUpApi.getActiveModel();
// Watch for tool activationsmodel.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
Properties
Section titled “Properties”
readonlyid:number
A predefined numeric identifier unique to this tool.
For example, the Rectangle tool is 21094.
readonlyname:string
The display name of this tool, like 'PaintTool'.
Methods
Section titled “Methods”toString()
Section titled “toString()”toString():
string
Returns
Section titled “Returns”string