cls ![]()
$ is the prefix for a global variable. You should never use global variables.
They are for reading by everyone. Only the Ruby Core and the Trimble SketchUp Team should create global variables.
Instead, use class variables like @@var_name, or instance variables like @var_name, or local variables like var_name.
ALL of your code must be inside YOUR toplevel author module, and each of your plugins should be in a sub-module inside your toplevel module.
If you have SketchUo 2016, in the “su_examples” sub-folder of “Plugins”:
“%AppData%/SketchUp/SketchUp 2016/SketchUp/Plugins/su_examples”
The “%AppData%/SketchUp/SketchUp 2016/SketchUp/Plugins/su_examples.rb” file creates a SketchupExtension instance, that allows users to switch the extension loading On or OFF.
menu: Window > Preferences > Extensions
Highlight the “Ruby Script Examples” and check the box.

Yes. In the Console:
require "su_examples/box.rb"
… from then on, you call the command method:
Sketchup::Examples.create_box
Who knows? This example was written perhaps 15 years ago.
Maybe the default template (at that time) used “Engineering / feet” as the unit setting.
72 / 6 = 12
1 foot / 12 = 1 inch.
SketchUp use decimal inches internally. So most everywhere in the API your values will be entered in inches. The API created a special subclass Length (a subclass of Numeric) for this. See these classes:
class Length
class Numeric
First of all that was the correct thing to do, to make the example use meter units.
The method call .m() was added by the API to the Numeric class, in order to allow coders to specify lengths equal to metric units. The result of the .m() method call is an instance of the Length class (whose value is always in inches.)
There must be some other method named create_box() defined globally (at the toplevel which is inside Object.) This is bad. The method defined inside the Sketchup::Examples namespace modules is the one that needs to be executed.