Top Level Namespace

Defined Under Namespace

Modules: Geom, Layout, Sketchup, UI Classes: Array, LanguageHandler, Length, Numeric, SketchupExtension, String

Constants for Sketchup.set_status_text position types # collapse

SB_PROMPT
SB_VCB_LABEL
SB_VCB_VALUE

Constants for 2D Geometry # collapse

ORIGIN_2D
X_AXIS_2D
Y_AXIS_2D
IDENTITY_2D

Constants for 3D Geometry # collapse

ORIGIN
X_AXIS
Y_AXIS
Z_AXIS
IDENTITY

Constants for UI.messagebox types # collapse

MB_OK
MB_OKCANCEL
MB_ABORTRETRYIGNORE
MB_YESNOCANCEL
MB_YESNO
MB_RETRYCANCEL
MB_MULTILINE

Constants for Tool key events # collapse

VK_SPACE
VK_PRIOR
VK_NEXT
VK_END
VK_HOME
VK_LEFT
VK_UP
VK_RIGHT
VK_DOWN
VK_INSERT
VK_DELETE
VK_SHIFT
VK_CONTROL
VK_ALT
VK_COMMAND
VK_MENU

Constants for Tool modifier keys in key and mouse events # collapse

ALT_MODIFIER_KEY
ALT_MODIFIER_MASK
COPY_MODIFIER_KEY
COPY_MODIFIER_MASK
CONSTRAIN_MODIFIER_KEY
CONSTRAIN_MODIFIER_MASK

Constants for UI.messagebox return values # collapse

IDOK
IDCANCEL
IDABORT
IDRETRY
IDIGNORE
IDYES
IDNO

Constants for scene update flags # collapse

PAGE_USE_CAMERA
PAGE_USE_RENDERING_OPTIONS
PAGE_USE_SHADOWINFO
PAGE_USE_SKETCHCS
PAGE_USE_HIDDEN
PAGE_USE_HIDDEN_GEOMETRY
PAGE_USE_HIDDEN_OBJECTS
PAGE_USE_LAYER_VISIBILITY
PAGE_USE_SECTION_PLANES
PAGE_USE_ALL
PAGE_NO_CAMERA
PAGE_USE_ENVIRONMENT

Constants for text arrow types # collapse

DimensionArrowNone
DimensionArrowSlash
DimensionArrowDot
DimensionArrowClosed
DimensionArrowOpen

Constants for text leader types # collapse

ALeaderNone
ALeaderView
ALeaderModel

Constants for View draw and View draw2d # collapse

GL_POINTS
GL_LINES
GL_LINE_LOOP
GL_LINE_STRIP
GL_TRIANGLES
GL_TRIANGLE_STRIP
GL_TRIANGLE_FAN
GL_QUADS
GL_QUAD_STRIP
GL_POLYGON

Constants for layer behavior # collapse

LAYER_VISIBLE_BY_DEFAULT
LAYER_HIDDEN_BY_DEFAULT
LAYER_USES_DEFAULT_VISIBILITY_ON_NEW_PAGES
LAYER_IS_VISIBLE_ON_NEW_PAGES
LAYER_IS_HIDDEN_ON_NEW_PAGES

Constants for command IDs # collapse

CMD_SELECT
CMD_PAINT
CMD_ERASE
CMD_RECTANGLE
CMD_LINE
CMD_CIRCLE
CMD_ARC
CMD_POLYGON
CMD_FREEHAND
CMD_PUSHPULL
CMD_TEXT
CMD_MOVE
CMD_ROTATE
CMD_EXTRUDE
CMD_SCALE
CMD_OFFSET
CMD_MEASURE
CMD_PROTRACTOR
CMD_SKETCHCS
CMD_SECTION
CMD_DRAWOUTLINES
CMD_DRAWCUTS
CMD_ORBIT
CMD_DOLLY
CMD_ZOOM
CMD_ZOOM_WINDOW
CMD_ZOOM_EXTENTS
CMD_CAMERA_UNDO
CMD_WIREFRAME
CMD_HIDDENLINE
CMD_SHADED
CMD_TEXTURED
CMD_TRANSPARENT
CMD_WALK
CMD_PAN
CMD_MAKE_COMPONENT
CMD_DIMENSION
CMD_VIEW_ISO
CMD_VIEW_TOP
CMD_VIEW_FRONT
CMD_VIEW_RIGHT
CMD_VIEW_BACK
CMD_VIEW_LEFT
CMD_VIEW_BOTTOM
CMD_VIEW_PERSPECTIVE
CMD_POSITION_CAMERA
CMD_NEW
CMD_OPEN
CMD_SAVE
CMD_CUT
CMD_COPY
CMD_PASTE
CMD_DELETE
CMD_UNDO
CMD_REDO
CMD_PRINT
CMD_PAGE_NEW
CMD_PAGE_DELETE
CMD_PAGE_UPDATE
CMD_PAGE_NEXT
CMD_PAGE_PREVIOUS
CMD_RUBY_CONSOLE
CMD_SKETCHAXES
CMD_SHOWHIDDEN
CMD_SHOWHIDDENGEOMETRY
CMD_SHOWHIDDENOBJECTS
CMD_SHOWGUIDES
CMD_SELECTION_ZOOM_EXT
CMD_DISPLAY_FOV

Constants for Command and Menu Validation # collapse

MF_ENABLED
MF_GRAYED
MF_DISABLED
MF_CHECKED
MF_UNCHECKED

Constants for Toolbar states # collapse

TB_HIDDEN
TB_VISIBLE
TB_NEVER_SHOWN

Constants for horizontal text alignment. # collapse

TextAlignLeft
TextAlignRight
TextAlignCenter

Constants for vertical text alignment. # collapse

TextVerticalAlignBoundsTop
TextVerticalAlignBaseline
TextVerticalAlignCapHeight
TextVerticalAlignCenter

Constants for TextureWriter return values # collapse

FILE_WRITE_OK
FILE_WRITE_FAILED_INVALID_TYPE
FILE_WRITE_FAILED_UNKNOWN

Constants for component behavior # collapse

SnapTo_Arbitrary
SnapTo_Horizontal
SnapTo_Vertical
SnapTo_Sloped

Constant Summary # collapse

SKETCHUP_CONSOLE

Instance Method Summary # collapse

Instance Method Details

#add_separator_to_menu(menu_name) ⇒ Object

Version:

  • SketchUp 6.0

#file_loaded(filename) ⇒ Object

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:

Returns:

  • (Boolean)

See Also:

Version:

  • SketchUp 6.0

#inputbox(*args) ⇒ Object

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) ⇒ Object

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_panelObject

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