Export an Image from SketchUp with Ruby (Snippet)

Export an Image from SketchUp with Ruby (Snippet)

The resulting image The following is a handy little Ruby tool if you frequently need to export the current view as an image in SketchUp. It basically allows you to pre-set all of the export parameters (including an export location) and keeps all of those consistent. Of course, this is not too hard with SketchUp itself (because it remembers the last used location and image parameters), but this script allows you to keep those parameters consistent even if SketchUp "forgets" them occasionally (i.e. after you work with a file in a different location). I use this script mainly when I need to create consistent images from many files, on which I work over an extended period of time. For that purpose, I have it set up as a menu item. In the example below, the image is exported as a JPG (just change jpg to png if you prefer that file format) at a size of 3000 px (with a 16:9 aspect ratio)....
Read More
Calculating Summed-up Volumes with Ruby (Snippet)

Calculating Summed-up Volumes with Ruby (Snippet)

I received an email a few days ago by someone who needed to calculate volumes and face areas in SketchUp for the purpose of estimating. I suggested doing this in a few lines with Ruby and as it turns out, it is pretty easy as long as the objects that need to be summed up are "solid" groups in SketchUp. I thought the solution could be useful for others, too, so here it is: Here's the total Just paste the code below into the Ruby Code Editor in SketchUp. Then select the groups that you would like to sum up and press the Run button. With this version, you will get the sum of the volumes as well as the areas of the perimeter surfaces (e.g. for estimating formwork). You can use this piece of code and customize it to your liking. For example, you could export the data separately for each object to a text file (or to a multiline messagebox) for use in...
Read More