Running SketchUp with command line redirection
-
@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. -
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?
-
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.txtand "C:\Program Files\Google\Google SketchUp 8 > debug.txt"
In the target line, but neither worked.
-
@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.txtand "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.
-
-
Turns out, I was using a BAT file...
"C:\Program Files (x86)\Google\Google SketchUp 7\Sketchup.exe" > myRubyLog.txt
-
@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.
-
@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.
-
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
-
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
Advertisement