untitled.rb

   Go to:  

Code Editor

Font size:  

Indent unit:  

Indent on enter:  

Show line numbers

Always save backup file (with BAK ending)

Wrap entire code in single undo

Reference Browser

Page zoom (not 100% reliable):  

Design

User interface style:  

Get Updates

Check for latest version  and download updates here.

SketchUp Ruby Code Editor

By: Alexander Schreyer
Version: 2.0 (4/12/2011)


Contributors: Jim Folz (Web Console code), Dan Rathbun and others at SCF

This code editor allows creating and modifying Ruby scripts directly within SketchUp. These scripts can be used to create geometry, add functionality or add data within the SketchUp 3D modeling environment.

This editor was originally an extension of Jim Folz's excellent Web Console plugin.

I modified it mainly for two reasons: When I code, I permanently need to look up documentation. To fix this, I added a bunch of reference webpages to a browser in a tab. The other reason was that I wanted it to behave a bit more like a real code editor, so I added a bit of jQuery magic to make it look good and have some additional features. The editor now also uses the Codemirror 2.0 syntax highlighter to make the code more readable.

At this point, this editor has the following features:

  • Execute multiline Ruby code directly in SketchUp
  • Open and save files
  • Fast opening of large files
  • Nice and clean user interface
  • Tab key works as expected in editor (inserts spaces or tabs)
  • Indenting of code blocks
  • Dropdown with code snippets inserts snippets at cursor
  • On save, a backup file can be created
  • Text size dropdown selects editor font size
  • Line numbering in editor
  • Matching brackets highlighting
  • Undo in editor
  • Undo (of code execution) button next to run button
  • Single undo for entire code or multiple undo steps
  • Results window keeps track of history
  • Reliable editor dialog resizing
  • Tab and accesskey navigation
  • Reference web browser for common reference websites
  • Browser zoom
  • Style changer for user interface
  • Buttons to explore selection object properties and object attributes
  • Button for direct access to the Ruby console
  • Clean printing of code
  • Version update checking

Issues:

  • Page zoom does not work well in reference browser - just use this as a backup if the font is unreadable
  • Doesn't like to work when other code editors are running in SketchUp - Just restart SketchUp if there are problems
  • Coloring sometimes needs text change to update

For feedback and feature suggestions, visit my webpage and leave a comment.