Executing a ruby file
-
Hi,
I was just wondering how I would execute an external .rb file on an event. I have a file called box.rb which is one of googles examples however how do I run this when a button is pressed?
Simon
-
If you look in the box.rb file you see the menu creation:
UI.menu("Draw").add_item($exStrings.GetString("Box")) { create_box }
So from that you know the command to trigger the command:
create_box
-
That is assuming that
box.rb
is loaded. -
@thomthom said:
So from that you know the command to trigger the command:
create_box
...
That is assuming that box.rb is loaded.HOWEVER... there is a bug in box.rb, if Tools/make_pano_pm.rb is also loaded (it loads after box.rb,) and redefines the
create_box
method; so the box object is never created.I posted a fixed version of box.rb
[Example] box.rb version 2.0.0
Advertisement