Categories

Monday, 11 March 2013

What sits in YOUR_PLUGIN_base.rb ?

So what exactly sits in the files that were mentioned in the last post ?
Let's start with YOUR_PLUGIN_base. rb file.

Lines 1 to 19 are description of the plugin, this part should be quite obvious. 
Lines 21, 22 and 23 are call-outs for 3 files that are necesary for our plugin to function.

"sketchup.rb" includes all genereal ruby function definitions that sketchup normaly uses,

"YOUR_LIB.rb" includes definitions of Your functions and

"YOUR_PLUGIN.rb" includes definition of tour plugin.

Lines from 25 are executed only if this file was not already loaded.

Line 27 adds new submenu YOUR_PLUGIN to Sketchup's Plugin menu.

Line 29 adds new toolbar YOUR_PLUGIN to Sketchup.

Line 33 defines a new comand "cmd , which calls out a new tool  - YOUR_PLUGIN.

Line 34 and 35 show path to icons that will sit in toolbar.

Line 36 is a tooltip - a text that will appeara whrn you hold a cursor above your toolbar.

Line 37 -  sets the status bar text for your plugin

Line 38 -  sets the menu item name for your plugin

Lines 39 and 40 - add YOUR_PLUGIN tool to new menu and toolbar





No comments:

Post a Comment