Some of the objects I'm creating in my Sketchup Plugin contain nested array properties. They are difficult to read in Sketchup's Ruby Console when calling object.inspect.
Is it possible to use Awesome Print from within a Sketchup Plugin? I don't believe the Sketchup Ruby Console supports syntax highlighting - can I hack ap
to write to a real console? Or write the output of ap
to a file?
I'm running Sketchup using Wine - so for all practical purposes... I'm on Windows.
I asked it on the Sketchup Forums. I got a fantastic answer from Aerilius.
You can get output to a text file, either by calling your own "log" method, or by redirecting $stdout (but it gets not all messages and $stderr is empty).
It's known that the Ruby Console in SketchUp is not very comfortable for developers (and slow, and you can't clear it). There have been several projects to improve it:
- WebConsole (Jim Foltz)
- Ruby Console Pro (Martin Rhinehart)
- Ruby Code Editor (Alex Schreyer)
- Ruby Console+ (Aerilius)
Under Trimble there seems to happen a lot of investment into the developer community and the SketchUp team recently published their internal development tools as open source on github. I recently merged syntax highlighting into it: sketchup-developer-tools
It has not yet as many features as Ruby Console+, but it can output to a file.
It would be really cool if you want to implement Awesome Print after the input has been evaled.