• Login
sketchucation logo sketchucation
  • Login
πŸ€‘ SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

Running SketchUp with command line redirection

Scheduled Pinned Locked Moved Developers' Forum
14 Posts 3 Posters 2.5k Views
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.
  • A Offline
    Al Hart
    last edited by 23 Sept 2010, 13:46

    I want to explain to a client how to run SketchUp, and direct to output to a file.

    e.g. C:\Program Files\Google\Google SketchUp 8>sketchup > debug.txt

    The user has never used a command prompt window before.

    1. Is there an easy way to run Sketchup.exe with output redirection from Windows explorer.

    2. Or is there some other easy to do this.

    Also, I am worried that if she has Windows 7, she will not be able to write to a debug.txt file in Program files.

    Any ideas?

    Al Hart

    http://wiki.renderplus.com/images/e/ef/Render_plus_colored30x30%29.PNG
    IRender nXt from Render Plus

    1 Reply Last reply Reply Quote 0
    • T Offline
      thomthom
      last edited by 23 Sept 2010, 13:56

      Send the client a shortcut they can run?
      I got one on my desktop to start SU in debug mode - and it outputs the txt file on the desktop.

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

      1 Reply Last reply Reply Quote 0
      • A Offline
        Al Hart
        last edited by 23 Sept 2010, 14:01

        @thomthom said:

        Send the client a shortcut they can run?
        I got one on my desktop to start SU in debug mode - and it outputs the txt file on the desktop.

        Can you send me (al.hart @ renderplus.com ) the shortcut, or post it here.

        Thanks,

        Al

        Al Hart

        http://wiki.renderplus.com/images/e/ef/Render_plus_colored30x30%29.PNG
        IRender nXt from Render Plus

        1 Reply Last reply Reply Quote 0
        • T Offline
          thomthom
          last edited by 23 Sept 2010, 14:06

          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
          • T Offline
            thomthom
            last edited by 23 Sept 2010, 14:18

            @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
            • A Offline
              Al Hart
              last edited by 23 Sept 2010, 14:20

              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.com/images/e/ef/Render_plus_colored30x30%29.PNG
              IRender nXt from Render Plus

              1 Reply Last reply Reply Quote 0
              • A Offline
                Al Hart
                last edited by 23 Sept 2010, 14:24

                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.com/images/e/ef/Render_plus_colored30x30%29.PNG
                IRender nXt from Render Plus

                1 Reply Last reply Reply Quote 0
                • T Offline
                  thomthom
                  last edited by 23 Sept 2010, 14:26

                  @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 23 Sept 2010, 14:34

                    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
                    • T Offline
                      thomthom
                      last edited by 23 Sept 2010, 14:49

                      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
                      • A Offline
                        Al Hart
                        last edited by 23 Sept 2010, 15:33

                        @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.com/images/e/ef/Render_plus_colored30x30%29.PNG
                        IRender nXt from Render Plus

                        1 Reply Last reply Reply Quote 0
                        • A Offline
                          Al Hart
                          last edited by 23 Sept 2010, 15:47

                          @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.com/images/e/ef/Render_plus_colored30x30%29.PNG
                          IRender nXt from Render Plus

                          1 Reply Last reply Reply Quote 0
                          • A Offline
                            Al Hart
                            last edited by 23 Sept 2010, 15:54

                            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.com/images/e/ef/Render_plus_colored30x30%29.PNG
                            IRender nXt from Render Plus

                            1 Reply Last reply Reply Quote 0
                            • A Offline
                              Al Hart
                              last edited by 24 Sept 2010, 06:55

                              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.com/images/e/ef/Render_plus_colored30x30%29.PNG
                              IRender nXt from Render Plus

                              1 Reply Last reply Reply Quote 0
                              • 1 / 1
                              1 / 1
                              • First post
                                12/14
                                Last post
                              Buy SketchPlus
                              Buy SUbD
                              Buy WrapR
                              Buy eBook
                              Buy Modelur
                              Buy Vertex Tools
                              Buy SketchCuisine
                              Buy FormFonts

                              Advertisement