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
The active_tool_id method is used to retrieve the active tool's id.
Returns:
tools = Sketchup.active_model.tools id = tools.active_tool_id
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:
tools = Sketchup.active_model.tools if tools.active_tool_id.equal? 0 puts "Tools collection is empty" else name = tools.active_tool_name end
The add_observer method is used to add an observer to the current object.
Arguments:
Returns:
tools = Sketchup.active_model.tools observer = Sketchup::ToolsObserver.new status = tools.add_observer observer
The model method is used to get the model associated with this tools object.
Returns:
tools = Sketchup.active_model.tools model = tools.model
The pop_tool method is used to pop the last pushed tool on the tool stack.
Returns:
tools = Sketchup.active_model.tools tool = tools.pop_tool
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:
Returns:
tools = Sketchup.active_model.tools status = tools.push_tool tool
The remove_observer method is used to remove an observer from the current object.
Arguments:
Returns:
tools = Sketchup.active_model.tools observer = Sketchup::ToolsObserver.new tools.add_observer observer status = tools.remove_observer observer