My favorites | English | Sign in

Faster apps faster - GWT 2.0 with Speed Tracer New!

Google SketchUp Ruby API

Tools

class

Parent: Object

Introduction

SketchUp 6.0+

The Tools class contains methods to manipulate a collection of SketchUp tools. You access this collection by calling the Model.tools method.

     tools = Sketchup.active_model.tools

Methods

Tools.active_tool_idSketchUp 6.0+

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

Returns:

id
the active tool's id.
 tools = Sketchup.active_model.tools
 id = tools.active_tool_id

Tools.active_tool_nameSketchUp 6.0+

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

Returns:

name = the active tool's name.
 tools = Sketchup.active_model.tools
 name = tools.active_tool_name

Tools.add_observerSketchUp 6.0+

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

Arguments:

observer
An observer.

Returns:

status
true if successful, false if unsuccessful.
 tools = Sketchup.active_model.tools
 status = tools.add_observer observer

Tools.modelSketchUp 6.0+

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

Returns:

model
a Model object associated with this tool.
 tools = Sketchup.active_model.tools
 model = tools.model

Tools.pop_toolSketchUp 6.0+

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

Returns:

tool
the last pushed Tool object.
 tools = Sketchup.active_model.tools
 tool = tools.pop_tool

Tools.push_toolSketchUp 6.0+

The push_tool method is used to push (aka activate) a user-defined tool. See the Tool interface for details on creating your own SketchUp tool.

Arguments:

tool
A user.

Returns:

status
true if successful, false if unsuccessful.
 tools = Sketchup.active_model.tools
 status = tools.push_tool tool

Tools.remove_observerSketchUp 6.0+

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

Arguments:

observer
An observer.

Returns:

true if successful, false if unsuccessful.
 tools = Sketchup.active_model.tools
 status = tools.remove_observer observer