Sunday, August 28, 2011

Customize the functionality of sketchup with Ruby API

Sketchup Ruby API

SketchUp Ruby API empowers sketchup users to extend and customize the functionality of sketchup according to their requirements. Ruby application programming interface (API) is embedded within sketchup. This interface facilitates users to create tools, menu items, and other plugins, such as automated component generators, to be included in the menus within SketchUp. Besides the API, SketchUp also contains a Ruby console which is an environment where you can experiment with Ruby commands or methods.

For additional information on the Ruby programming language, visit www.rubycentral.com.

To learn more about the SketchUp Ruby API, visit Google’s Ruby API Code Site. This site contains an FAQ, tutorials, documentation, and the Google SketchUp Developers Forum.

Currently, Google does not offer technical support for the Ruby Application Programmers Interface (API) or for any Ruby plugins created by third parties. General Ruby information may be obtained at http://www.ruby-lang.org/en/.

Google SketchUp Pro 7 or higher version is required to produce and edit Dynamic Components. Dynamic Components are represented with a little, green icon that looks like this

Steps to complete the installation and Demo :

Install Google SketchUp
Install Ruby
Create a script file named as googlesketch.rb
Save it in the Plugins folder ("c:\Program Files\Google\Google SketchUp [n]\Plugins")
To run our plugin we simply need to start Sketchup (or restart, if it's already open.)
If everything went well you'll see "Woooo!! Welcome to Google Sketch World......" every time you start the program.This one line of code uses the UI module's messagebox method to show the alert box. UI is one of the "big three" modules that provide hooks for manipulating SketchUp with Ruby. The other modules are SketchUp and Geom.
Create custom drawing tools.

Build advanced tools that increase your modeling speed and allow you to generate complex objects with a few clicks.

Automate common tasks

Almost anything that you can do manually in SketchUp can be automated with the API. If you or your company has repetitive modeling needs, a script can save you time and money.

Annotate and report

Create 3d models that go beyond geometry. You can attach text or numeric attributes to any part of a SketchUp model and then generate reports.

Build a plugin business

SketchUp is one of the most widely used 3D drawing programs on the planet. By using Google's free Ruby Scrambler, you can protect your IP and sell your plugins to this substantial user base.

Google SketchUp API Blog
Hidden Corners of SketchUp's Ruby API: Transforming Vertices
Being a Good SketchUp Ruby Citizen
Turn Your Plugin Into An Extension


Posted by Rajib
Business Development
Visit us at www.sketchup4architect.com
Download our sketchup magazine

No comments:

Post a Comment