This is the companion page for Chapter 7 of the book Architectural Design with SketchUp.
On This Page
From the Book

In this chapter of Architectural Design with SketchUp, you will create scripted geometry in SketchUp. Often called computational geometry, this is an exciting current topic that allows you to produce 3D shapes and arrangements that are impossible (or at least hard) to create by hand. Scripting in SketchUp also allows you to automatize repetitive tasks or facilitate data exchange with text files.
If you are new to scripting (or coding), then this chapter can serve as a thorough general introduction. You will learn principles that are common to many scripting languages, and you will apply those to creating items in SketchUp’s 3D environment—items that you can even fabricate (using instructions from Chapter 6).
Because the underlying Ruby scripting language is not available in SketchUp’s web or iPad apps, this chapter can only be used with the desktop SketchUp (Pro) version.
Chapter Sections:
- Why Computational Geometry?
- Setting Up SketchUp’s Ruby Interface
- Intro to Ruby and the SketchUp API
- Creating Geometry with Ruby
- Transformations Change Things Up
- Attracted to Attractors
- What Else Is Possible with This?
- Some Pitfalls and Things to Watch Out For
Note: This was Chapter 6 in the first edition.
Go beyond the book:
Check out my tutorials on this site in the Scripting category
SketchUp Models In This Chapter
Below are two of the models that you can explore interactively in your browser (click and drag to orbit):
View and download all models from this chapter on the 3D Warehouse.
Links In This Chapter
Updated links will be listed here:
- ruby-lang.org
- ruby.sketchup.com
- github.com/SketchUp/sketchup-ruby-debugger
- try.ruby-lang.org
- ruby-doc.org
- en.wikibooks.org/wiki/Ruby_Programming
- techotopia.com/index.php/Ruby_Essentials
- zenspider.com/ruby/quickref.html
- developer.sketchup.com
- ruby.sketchup.com/_index.html
- forums.sketchup.com/c/developers/12
- sketchucation.com/forums/viewforum.php?f=180
Download The Script Examples
You can save yourself some typing and download all Ruby scripts from this chapter as a ZIP archive:
Sample Videos From This Chapter (from the 2nd Edition)
You can access all Chapter 7 videos using the password from the book on Wiley’s companion site: www.wiley.com/go/schreyer2e
All Chapter 7 videos:
- 0701: Fun with coding in SketchUp (for all ages) (included here)
- 0702: Intro to coding with the Ruby Code Editor (included here)
- 0703: Mapping an object onto a shell
Next Steps
- Check out my tutorials on this site in the Scripting category
UP NEXT:
Chapter 8 shows how you can use LayOut for documentation.
Discuss This Chapter
Use the discussion area below to add any comments, tips, tricks etc. for this chapter…