SketchUp  Ruby API Reference 

Class Index

Method Index

Developers Guide

Examples

Tools class

The Tools class contains methods to manipulate a collection of SketchUp tools.

Parent:

Methods: add_observer, active_tool_id, active_tool_name, model, pop_tool, push_tool, remove_observer

Example Code:

Instance Methods


add_observer

The add_observer method is used to add an observer to the current object.

Syntax

status = object.add_observer observer

Arguments

observer - an observer

Return Value

status - true if successful, false if unsuccessful.

Example

 

 


active_tool_id

The activate_tool method is used to retrieve the active tool's id.

Syntax

id = tools.active_tool_id

Return Value

id - the active tool's id.

Example

 

 


active_tool_name

The active_tool_name method is used to retrieve the active tool's name.

Syntax

name = tools.active_tool_name

Return Value

name = the active tool's name.

Example

 

 


model

The model method is used to get the model associated with this tools object.

Syntax

model = tools.model

Return Value

model - a Model object associated with this tool.

Example

 

 


pop_tool 

The pop_tool method is used to pop the last pushed tool on the tool stack.

Syntax

tool = tools.pop_tool

Return Value

tool - the last pushed Tool object.

Example

 

 


push_tool

The push_tool method is used to push a user-defined tool.

Syntax

status = tools.push_tool tool

Arguments

tool - a user-defined Tool object.

Return Value

status - true if successful, false if unsuccessful.

Example

 

 


remove_observer

The remove_observer method is used to remove an observer from the current object.

Syntax

status = tools.remove_observer observer

Arguments

observer - an observer

Return Value

true if successful, false if unsuccessful.

Example

 

SketchUp  Ruby API Reference: Tools class

© Google Inc. 2007 sketchup.google.com