This code editor extension offers an easy-to-use and visually appealing way to write and modify Ruby scripts directly within SketchUp. These scripts can then be used to create geometry, add functionality or add data within the SketchUp 3D modeling environment. The SketchUp Ruby API provides an extensive set of functions to automatize SketchUp in many ways or create scripted, computational geometry.
This SketchUp extension was created out of a need for having extensions available in a “locked down” computer lab setting (similar to my solution for AutoCAD). It also provides an easy way to use extensions in SketchUp without having to install them – therefore making SketchUp start (and possibly run) faster. In addition, you can use this tool to run any external ruby code (e.g. for development purposes).
A little while ago, I had a need for calculating centroids for planar shapes in SketchUp. To be more exact, my students had the need since I gave them an assignment that required this. Not knowing of a plugin for SketchUp that would accomplish this feat, they did it in Rhino or AutoCAD instead.
To rid SketchUp of this shortcoming, I decided to re-use some old Pascal code of mine and try my hand at writing a plugin for this. Here is the result.