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.rbis 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_boxmethod; so the box object is never created.I posted a fixed version of box.rb
[Example] box.rb version 2.0.0
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better π
Register LoginAdvertisement