sketchucation logo sketchucation
    • Login
    šŸ›£ļø Road Profile Builder | Generate roads, curbs and pavements easily Download

    Running SketchUp with command line redirection

    Scheduled Pinned Locked Moved Developers' Forum
    14 Posts 3 Posters 2.6k 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.
    • thomthomT Offline
      thomthom
      last edited by

      It's on my home computer, but it's not a universal shortcut - as it needs to fit the SU version, location (locale and 64/32bit OS differences), but it's just adding a shortcut with the > debug.txt argument.

      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

        @al hart said:

        One thing that makes this tricky is guessing whether the user has a 64-bit machine, Windows 7, etc. The user is in Australia, so I often only get to exchange 1 email per day because of the way our time zones overlap.

        I guess you can make a BAT file that tests for common locations... ? Or pull the location from the registry.

        @al hart said:

        Also, what to you replace '> debug.txt' with to put it on the desktop?

        I don't - that's all I do.
        But if I use CMD and navigate to SU's folder and launch SU then the txt file is created in the SU folder. So it appear to depend on where you started SU from. Or maybe you can control this by using the "Start in" field on the shortcut properties.

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

        1 Reply Last reply Reply Quote 0
        • Al HartA Offline
          Al Hart
          last edited by

          Thanks for your help on this.

          What to you replace '> debug.txt' with to put it on the desktop?

          I guess I was hoping for a way for the client to navigate to the SketchUp folder, and then do something from Windows explorer.

          I just went to explorer, right clicked on SketchUp.exe and selected "Create Shortcut", then clicked on the shortcut and selected properties.

          But I can't figure out where to put the redirection?


          shortcut.jpg

          Al Hart

          http:wiki.renderplus.comimageseefRender_plus_colored30x30%29.PNG
          IRender nXt from Render Plus

          1 Reply Last reply Reply Quote 0
          • Al HartA Offline
            Al Hart
            last edited by

            oops - I edited my previous post while you were responding to it.

            How do you redirect output in a shortcut?
            I tried: "C:\Program Files\Google\Google SketchUp 8" > debug.txt

            and "C:\Program Files\Google\Google SketchUp 8 > debug.txt"

            In the target line, but neither worked.

            Al Hart

            http:wiki.renderplus.comimageseefRender_plus_colored30x30%29.PNG
            IRender nXt from Render Plus

            1 Reply Last reply Reply Quote 0
            • thomthomT Offline
              thomthom
              last edited by

              @al hart said:

              oops - I edited my previous post while you were responding to it.

              How do you redirect output in a shortcut?
              I tried: "C:\Program Files\Google\Google SketchUp 8" > debug.txt

              and "C:\Program Files\Google\Google SketchUp 8 > debug.txt"

              In the target line, but neither worked.

              About to head home now - but I noticed that the path you have there points to the SU folder - not the exe itself.

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

              1 Reply Last reply Reply Quote 0
              • M Offline
                mhd
                last edited by

                Here is what I threw together. Hope it helps.


                A Batch file to write the debug output to the desktop

                1 Reply Last reply Reply Quote 0
                • thomthomT Offline
                  thomthom
                  last edited by

                  Turns out, I was using a BAT file...
                  "C:\Program Files (x86)\Google\Google SketchUp 7\Sketchup.exe" > myRubyLog.txt

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

                  1 Reply Last reply Reply Quote 0
                  • Al HartA Offline
                    Al Hart
                    last edited by

                    @thomthom said:

                    Turns out, I was using a BAT file...
                    "C:\Program Files (x86)\Google\Google SketchUp 7\Sketchup.exe" > myRubyLog.txt

                    My client figured out how to get to the DOS prompt. But I would still love to figure out a good way to do this.

                    I could create a batch file which the user could unzip into the SketchUp folder.

                    Al Hart

                    http:wiki.renderplus.comimageseefRender_plus_colored30x30%29.PNG
                    IRender nXt from Render Plus

                    1 Reply Last reply Reply Quote 0
                    • Al HartA Offline
                      Al Hart
                      last edited by

                      @thomthom said:

                      Turns out, I was using a BAT file...
                      "C:\Program Files (x86)\Google\Google SketchUp 7\Sketchup.exe" > myRubyLog.txt

                      I create an image to a shortcut to the folder, however the proper shortcut still didn't work with either of these targets:

                      "C:\Program Files\Google\Google SketchUp 8\SketchUp.exe" > debug.txt

                      "C:\Program Files\Google\Google SketchUp 8\SketchUp.exe > debug.txt"


                      It turns out you can access the desktop with:

                      \users%USERNAME%\Desktop

                      as in:

                      echo xxx > \users%USERNAME%\Desktop\debug.txt

                      Here is a script which will work for 32 and 64 bit windows:

                      (I thought I would pass along my trick for making .bat files which work for both 32 and 64 bit systems)

                      
                      @echo off
                      
                      rem - goto proper Program Files
                      c;
                      if "%ProgramFiles(x86)%" == "" goto win32
                          set PFILES=%ProgramFiles(x86)%
                          goto process
                      ;win32
                          set PFILES=%ProgramFiles%
                      
                      ;process
                      echo executing "%PFILES%\Google\Google SketchUp 8\SketchUp.exe"
                      "%PFILES%\Google\Google SketchUp 8\SketchUp.exe" > \users\%USERNAME%\Desktop\debug.txt
                      
                      echo load debug.txt in notepad.
                      notepad \users\%USERNAME%\Desktop\debug.txt
                      
                      

                      Unfortunately, when SketchUp produced its bug splat, it had not flushed its output.

                      Al Hart

                      http:wiki.renderplus.comimageseefRender_plus_colored30x30%29.PNG
                      IRender nXt from Render Plus

                      1 Reply Last reply Reply Quote 0
                      • Al HartA Offline
                        Al Hart
                        last edited by

                        I see that Sketchup replaces $stdout with #Sketchup::Console:0x365e1b0

                        It has a write method, but no flush method

                        $stdout.methods - Object.methods
                        ["write"]

                        $stdout.flush
                        Error: #<NoMethodError: undefined method `flush' for #Sketchup::Console:0x365e1b0>

                        Maybe we can get SketchUp to add a flush method to Sketchup::Console ā“

                        Al Hart

                        http:wiki.renderplus.comimageseefRender_plus_colored30x30%29.PNG
                        IRender nXt from Render Plus

                        1 Reply Last reply Reply Quote 0
                        • Al HartA Offline
                          Al Hart
                          last edited by

                          All this work trying to redirect output led me to come up with a ruby script which will redirect output, and flush the output file.

                          See: http://forums.sketchucation.com/viewtopic.php?f=180&t=31160

                          Al Hart

                          http:wiki.renderplus.comimageseefRender_plus_colored30x30%29.PNG
                          IRender nXt from Render Plus

                          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