Archives

Tuesday April 27, 2010

"Automatic SketchUp: Creating 3-D Models in Ruby"

Although I've played with SketchUp Ruby from time to time over the past few years, my first real introduction occurred in the Fall of 2009. Igloo Studios, a well-known name in SketchUp modeling and training, brought me in to maintain some of their tools and create some others. Clearly, I had some homework to do.

Following my usual practice, I bought and skimmed several books on SketchUp. I also dug through assorted SketchUp web sites, perused mailing lists, etc. Unfortunately, none of this gave me the kind of "aha!" I was seeking. So, although I was able to bumble along, I didn't feel all that confident.

Recently, however, I was able to purchase the book I needed six months ago:

Introducing Ruby

Three of the initial chapters introduce Ruby programming concepts and syntax. I didn't need this information, but I read them anyway, out of curiosity. I've thought about teaching Ruby as a first programming language, so it was interesting to see how this book approached the task.

Because the book is not primarily about Ruby, it doesn't begin by introducing a slew of Ruby concepts and syntax. Instead, it presents a little bit of Ruby, then uses it with SketchUp. Then, back to the well for a bit more Ruby. I think this approach should work very well for aspiring Rubyists, providing them with both motivation and reinforcement.

To be sure, this book won't turn the reader into a Ruby expert, but that's not the goal. It certainly teaches enough Ruby to let new programmers attempt small plugins. There is certainly no shortage of good books on Ruby, if the reader decides to get serious about the language.

Introducing SketchUp

There are a number of books that introduce SketchUp concepts and use, so the book doesn't make much of an effort in this area. This is reasonable, given that one alternative might be a much larger book. Still, a few more explanatory paragraphs might not be out of place.

That said, the book really shines in the intermediate topics:

  • What are the key classes and methods in the API?

  • How does the API handle components, groups, layers, materials, pages, etc?

  • How do Ruby concepts (eg, arrays, iterators, objects) work with the API?

This part of the book is well worth the price of admission. The API web site lists all of the classes and methods, but this book actually explains how to use them. Given the paucity of overview material available elsewhere, this book is a badly needed resource.

In summary, if you've been trying to create or even modify SketchUp Ruby plugins, this book should be close at hand.

"Automatic SketchUp: Creating 3-D Models in Ruby" in Computers , Ruby , SketchUp , Technology - posted at Tue, 27 Apr, 22:01 Pacific | «e» | TrackBack

Comments

Hi! I come from Google's Ruby discussion site. I've already read it.

The book seems fit newbie of Sketchup AND Ruby. I'm using SKU with this book and O'REILLY "The Ruby Programming Language" (and Google site, of course). Almost all automatic drawing can be achieved with Ruby. To the moment, I don't need SDK.
But for the expert at Goggle's documentation site, this book may be felt something missing.
Also, it needs more detailed index.


Post a comment

Note: All comments are subject to approval. Spam will be deleted before anyone ever sees it. Excessive use of URLs may cause comments to be auto-junked. You have been warned.

Any posted comments will be viewable by all visitors. Please try to stay relevant ;-) If you simply want to say something to me, please send me email.