[Plugin] Debug tool: run lastloaded ruby
-
Hi!
This plugin simplifies the debugging process with a few mouse clicks. It works in conjunction with Jim Foltz' rubytoolbar, which can be found here:
http://sketchuptips.blogspot.com/2007/08/plugin-ruby-toolbar.html
Once you've loaded the script you want to debug through the rubytoolbar, you can simply reload and execute your script in one step.
How does it work?
Lastloaded.rb looks for a line in your code tagged with:
#loadme
So just put this string after the line in your code that Sketchup has to execute.
For example:<span class="syntaxdefault">new_menu </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> UI</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">menu</span><span class="syntaxkeyword">(</span><span class="syntaxstring">"Plugins"</span><span class="syntaxkeyword">)<br /></span><span class="syntaxdefault">cmd </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> UI</span><span class="syntaxkeyword">;;</span><span class="syntaxdefault">Command</span><span class="syntaxkeyword">.new(</span><span class="syntaxstring">"text"</span><span class="syntaxkeyword">)</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">{</span><span class="syntaxdefault">some command</span><span class="syntaxkeyword">}</span><span class="syntaxdefault"> </span><span class="syntaxcomment">#loadme<br /></span><span class="syntaxdefault">new_menu</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">add_item</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">cmd</span><span class="syntaxkeyword">)</span><span class="syntaxdefault"> </span>
Lastloaded will now reload your script and automatically runs 'some command' for you. The script has a menu item in the Tools section, so you can assign a shortcut if convenient.
Have fun! I'm open for questions / suggestions
Advertisement