sketchucation logo sketchucation
    • Login
    Oops, your profile's looking a bit empty! To help us tailor your experience, please fill in key details like your SketchUp version, skill level, operating system, and more. Update and save your info on your profile page today!
    πŸ«› Lightbeans Update | Metallic and Roughness auto-applied in SketchUp 2025+ Download

    Executing a ruby file

    Scheduled Pinned Locked Moved Developers' Forum
    4 Posts 3 Posters 248 Views 3 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • 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

      1 Reply Last reply 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

        1 Reply Last reply 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

          1 Reply Last reply 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.

            1 Reply Last reply 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