123456789_123456789_123456789_123456789_123456789_

Top Level Namespace

Relationships
Namespace Children
Modules:
Classes:

Constant Summary

Instance Method Summary

Instance Method Details

#add_separator_to_menu(menu_name)

Version:

  • SketchUp 6.0

#file_loaded(filename)

Call this function at the end of a file that you are loading to let the system know that you have loaded it.

Examples:

module Example
  unless file_loaded?(__FILE__)
    menu = UI.menu('Plugins')
    menu.add_item('Example') { self.hello }
    file_loaded(__FILE__)
  end

  def self.hello
    puts 'Hello World'
  end

end

Parameters:

See Also:

Version:

  • SketchUp 6.0

#file_loaded?(filename) ⇒ Boolean

Use in combination with #file_loaded to create load guards for code you don’t want to reload. Especially useful to protect your ::UI setup from creating duplicate menus and toolbars.

Examples:

module Example
  unless file_loaded?(__FILE__)
    menu = UI.menu('Plugins')
    menu.add_item('Example') { self.hello }
    file_loaded(__FILE__)
  end

  def self.hello
    puts 'Hello World'
  end

end

Parameters:

See Also:

Version:

  • SketchUp 6.0

#inputbox(*args)

This is a wrapper for UI.inputbox. You call it exactly the same as UI.inputbox. UI.inputbox will raise an exception if it can’t convert the string entered for one of the values into the right type. This method will trap the exception and display an error dialog and then prompt for the values again.

See Also:

Version:

  • SketchUp 6.0

#require_all(dirname)

Deprecated.

This adds the path given to $LOAD_PATH which can affect other extensions.

By default, SketchUp automatically loads (using require) all files with the .rb extension in the plugins directory. This function can be used to automatically load all .rb files from a different directory also. to use this add a call like the following to a file in the plugins directory require_all "MyRubyScripts"

Parameters:

Version:

  • SketchUp 6.0

#show_ruby_panel

Deprecated.

Use SKETCHUP_CONSOLE.show instead.

This global method is called by the Ruby Console menu item. We call this instead of directly calling Sketchup.send_action("showRubyPanel:") so that other Ruby Console implementations can hijack this method.

Version:

  • SketchUp 6.0