sketchucation logo sketchucation
    • Login
    πŸ›£οΈ Road Profile Builder | Generate roads, curbs and pavements easily Download

    Executing a ruby file

    scheduled pinned locked moved Developers' Forum
    4 Posts 3 Posters 240 Views 3 Watching
    loading-more-posts
    • oldest-to-newest
    • newest-to-oldest
    • most-votes
    reply
    • reply-as-topic
    guest-login-reply
    deleted-message
    • S Offline
      simonstaton
      last edited by

      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

      one-reply-to-this-post last-reply-time reply quote 0
      • thomthomT Offline
        thomthom
        last edited by

        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

        Thomas Thomassen β€” SketchUp Monkey & Coding addict
        List of my plugins and link to the CookieWare fund

        one-reply-to-this-post last-reply-time reply quote 0
        • thomthomT Offline
          thomthom
          last edited by

          That is assuming that box.rbis loaded.

          Thomas Thomassen β€” SketchUp Monkey & Coding addict
          List of my plugins and link to the CookieWare fund

          one-reply-to-this-post last-reply-time reply quote 0
          • Dan RathbunD Offline
            Dan Rathbun
            last edited by

            @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

            I'm not here much anymore.

            one-reply-to-this-post last-reply-time reply quote 0
            • 1 / 1
            • first-post
              last-post
            Buy SketchPlus
            Buy SUbD
            Buy WrapR
            Buy eBook
            Buy Modelur
            Buy Vertex Tools
            Buy SketchCuisine
            Buy FormFonts

            Advertisement