Tools

SketchUp 6.0+

class

Parent: Object

Introduction

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.

NOTE: Calling active_tool_name on an empty Tools collection might cause a crash. Before calling this method, it is important to check whether or not the Tools collection is empty. The Tools collection is empty if the method .active_tool_id returns zero.

Returns:

name = the active tool's name.
 tools = Sketchup.active_model.tools
 if tools.active_tool_id.equal? 0
   puts "Tools collection is empty"
 else
   name = tools.active_tool_name
 end

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
 observer = Sketchup::ToolsObserver.new
 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
 observer = Sketchup::ToolsObserver.new
 tools.add_observer observer
 status = tools.remove_observer observer

  

Trimble Home
About Trimble - Privacy Policy - Contact Us