Sketchup Resources

UKworkshop.co.uk

Help Support UKworkshop.co.uk:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.

Chris Knight

Established Member
Joined
14 Jan 2004
Messages
6,641
Reaction score
3
Location
SE London - NW Kent
Thanks for this Chris.

Really useful.

What do you do with the ruby files when downloaded? The Ruby help button doesn't show anything at all!? I have looked at the ruby site as directed by Sketchup help but its basically goobledegook to me. Do I need to be able to program/ undersatnd programming to use these files?


edit: okay think I've found out now - hadn't restarted Sketchup after moving the files into the plug in directory.

Cheers

Tim
 
Tim,

You need to start the Ruby Console (Menu: Window/Ruby Console) then type load'filepath/name'. It is spelt out in the separate Ruby Help section (Menu: Help/Ruby Help).

Depending on the file, you will then find it pops up in a variety of places. The example given in the Ruby Help shows up in the Camera menu for some reason and the cab.rb file shows up under the Plugins menu (which itself only appears after you load a Ruby file).

To add to this confusion, the Ruby Help file istelf is a little out of date and talks of the View menu when it means the Window menu!
 
Thanks Chris.

Chris":9ufh1v7t said:
It is spelt out in the separate Ruby Help section (Menu: Help/Ruby Help).

As I said:

Tim":9ufh1v7t said:
The Ruby help button doesn't show anything at all!?

When I click on Ruby Help, nothing happens at all - just get a 'done' written bottom left, no new window, nothing. Can't understand why. Any thoughts? :-k


Cheers

Tim
 
thanks for this Chris, something else to do whilst at work tomorrow *ahem* :wink:
 
Chris
Many thanks for posting these-very helpful!
The more I use Sketchup the more I love it-so easy to visualise what you are going to make. Makes life a lot easier when making things for other people as you can print out lovely 3D images for final approval.
Cheers
Philly :D
 
re: Ruby Scripts. If you are using a PC, put the scripts into the Plugins folder under SketchUp4.0. Also, look in the examples folder inside the plugins folder. Copy sketch.rb from the examples folder out into the Plugins folder. When you open SU, you should now have a menu called Plugins.

Most Ruby scripts will be accessed through the Plugins menu although some are accessed in the context menu (right click) and some are in other menus. You can find out where they are set to be accessed from by looking at the end of the script.

For example here is a very simple script whichopens the calculator in Windows from SketchUp.

require 'sketchup.rb'

# -----------------------------------------------------------------------------


# Add item "calculator" to the Draw menu.
# First check for existing menu load
if( not file_loaded?("calc.rb") )

UI.menu("Plugins").add_item("Calculator") { UI.openURL("calc.exe") }

end

# -----------------------------------------------------------------------------
file_loaded("calc.rb")

In the line "UI.menu("Plugins").... it tells SketchUp to put the word Calculator in the Plugins menu and run calc.exe when it is selected from the menu. If you were to change "Plugins" to "Tools" you would find Calculator in the Tools menu.

FWIW, if you want this script, copy all of it from the line "require 'sketchup.rb'" to "file_loaded("calc.rb")" inclusive and paste it into an blank WordPad or Notepad file. Save it as calc.rb (If it won't let you append the rb extension, rename the file after saving it). Save it in the Plugins folder in SketchUp.
 
Back
Top