SketchTalk by Example

SketchTalk comes from Edges to Rubies—The Complete SketchUp Tutorial
©2009, Martin Rinehart

Specifying 3d points, precisely.
[ red, green, blue ]
Pointing to origin. Sample 3d point specifications.

SketchTalk by Example Ruby Console 1. SketchTalk by Example SketchUp 1.
After loading SketchTalk, n empties the model.
SketchTalk by Example Ruby Console 2. SketchTalk by Example SketchUp 2.
Emulating keyboard shortcuts, r Rectangles between 3d points.
SketchTalk by Example Ruby Console 3. SketchTalk by Example SketchUp 3.
The box command Rectangles and then PushPulls.
SketchTalk by Example Ruby Console 4. SketchTalk by Example SketchUp 4.
The donut is a box with a hollow center.
SketchTalk by Example Ruby Console 5. SketchTalk by Example SketchUp 5.
Here, box creates a cabinet back.
SketchTalk by Example Ruby Console 6. SketchTalk by Example SketchUp 6.
Every new item is grouped and selected. The none command unselects all.
SketchTalk by Example Ruby Console 7. SketchTalk by Example SketchUp 7.
A new shelf is added by another box command.
SketchTalk by Example Ruby Console 8. SketchTalk by Example SketchUp 8.
Another keyboard shortcut, the g command creates and names a new component.
SketchTalk by Example Ruby Console 9. SketchTalk by Example SketchUp 9.
Move/Copy is done with the mc command.
SketchTalk by Example Ruby Console 10. SketchTalk by Example SketchUp 10.
A door frame is another donut.
SketchTalk by Example Ruby Console 11. SketchTalk by Example SketchUp 11.
A Rectangle is added for glass.
SketchTalk by Example Ruby Console 12. SketchTalk by Example SketchUp 12.
The frame and glass are turned into a component.
SketchTalk by Example Ruby Console 13. SketchTalk by Example SketchUp 13.
Move/Copy does its magic.
SketchTalk by Example Ruby Console 14. SketchTalk by Example SketchUp 14.
SketchTalk models are conventional models, too.
SketchTalk by Example SketchUp 15. SketchTalk by Example SketchUp 16.
Courtesy of the component, Bucketing one "glass" buckets them all.
SketchTalk by Example SketchUp 17.
Ready for your big screen TV. (A "box" for the screen; a "donut" frame, ...)

# /r/cabinet.rb

require '/r/sketch_talk'

n
donut [0,0,0],[96,0,30],15,1 
box [0,0,0],[96,-0.25,0],30 
none 
box [1,0,8],[95,15,8],0.75 
sh = g 'shelf' 
mc sh, [0,0,8], 2 
none 
donut [0,15,0],[24,15,30],1,2 
r [2,15.5,2],[22,15.5,28] 
df = g 'door_frame' 
mc df, [24,0,0], 3 

# end of /r/cabinet.rb

If you can SketchTalk it, you can collect your SketchTalk in a file.
Loading the file in the Ruby Console reissues all your commands at once.


The FAQs about SketchTalk:

SketchTalk cost: None. (Maybe for SketchTalk Pro ... )

SketchTalk prerequisite: basic SketchUp competence. Chapters 1 through 10, for instance.

Programming knowledge: None required. Fast track provided for programmers.

Tutorial navigation: Chapter icon and name link to chapter. Details link to sections.

To learn to SketchTalk: Last section, chapter 11, through third section, chapter 12

To turn cabinet.rb into a flexible Ruby: Fourth section, Chapter 12.

To add a slick UI: Last section, Chapter 12.

To write your own SketchTalk: (Because my SketchTalk will always be one feature short of what you really need) Chapters 13 and 14.

To find out why Monty wants to give Tim a big hug: All of 11 through 14.

Download: Chapter 11, Modeling with SketchTalk section.

Edges to Rubies—The Complete SketchUp Tutorial

Chapter Icon Name
11

details

Hello, World!, chapter 11 icon Introduction to Ruby Programming
 
12

details

Donut component, chapter 12 icon. SketchTalk in the Basement
 
13

details

Donut component, chapter 13 icon. SketchTalk Functions
 
14

details

Defining synonym classes for easy typing. SketchTalk Objects
 

Download: Chapter 11, Modeling with SketchTalk section.


# # #