• Login
sketchucation logo sketchucation
  • Login
🤑 SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

[Plugin] Debug tool: run lastloaded ruby

Scheduled Pinned Locked Moved Plugins
1 Posts 1 Posters 2.8k 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.
  • L Offline
    liquid98
    last edited by 25 Mar 2012, 09:11

    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:

    Link Preview Image
    Plugin: Ruby Toolbar

    This Windows-only plugin creates a Toolbar for controlling the Ruby Console It can open and close the Ruby console, clear the console, loa...

    favicon

    (sketchuptips.blogspot.com)

    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


    lastloaded.rb

    Things that flourish fall into decay. This is not-Tao, And what is not-Tao soon ends ~ Lao tse

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

    Advertisement