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!
    ⚠️ Important | Libfredo 15.6b introduces important bugfixes for Fredo's Extensions Update

    Help needed with Sketchup.exe -RubyStartup

    Scheduled Pinned Locked Moved Developers' Forum
    3 Posts 2 Posters 32 Views 2 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.
    • F Offline
      Frankn
      last edited by

      Hello everyone and happy new year!

      I'm trying to launch a new instance of SketchUp and have it open a plugin at start up... this what works to launch SketchUp but it doesn't run the file. Any ideas what I'm doing wrong?

      For now the file is just printing a line to the ruby console.

      path=File.join(__dir__, "test.rb")
      
      system('start "New SketchUp Window" "C:/Program Files/Sketchup/Sketchup 2019/SketchUp.exe" "-RubyStartup path"')
      

      Frank

      1 Reply Last reply Reply Quote 0
      • TIGT Online
        TIG Moderator
        last edited by TIG

        At startup SketchUp 'always' loads all .RB files that it finds in your user's Plugins folder.
        So simply having your Ruby code in a .RB file in that folder should load it, and also run any commands etc that it defines and chooses to run...
        Your _dir_ is running into issues because by the time it runs it's returning nil.
        What is your thinking behind this process ?

        TIG

        1 Reply Last reply Reply Quote 0
        • F Offline
          Frankn
          last edited by

          Let me try and explain what I'm trying to do because I have a few things I'd like to accomplish... this being what I think should be the first step. Though I tend to change/modify my ideas as I work on them.

          Basically I have a cabinet plugin I'm working on and one thing I'd like to do is add nesting/cut sheet/layout functionality... so basically...

          • identify all the top faces of the panels (I can do this).
          • make a copy of the faces before adding them to an array... still need to figure this out.
          • launch a new instance of SketchUp and adding the faces from the array I copied... I was thinking of making a ruby script to do this and then launch/open a plugin to manage the nesting options.

          I got the idea after finding this...
          https://community.sketchucation.com/topic/139502/sketchup-command-line-switches

          Hopefully that's not to confusing and makes some sense.

          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