[REQ] model is loaded alarm
-
For those of us who are not always working on the fastest computers out there, sometimes you want to open a relatively large and complex model which can jam sketchup for a couple of minutes. Precious minutes that could be spent on working on another model in a separate window, reading Sketchucation forums, and maybe even catching a couple of minutes of shut-eye.
Wouldn't it be wonderful if sketchup played an alarm tone/music/single beep/continuous beep/user selected mp3/... the minute the model is loaded? Do you think it's possible to write a script that would know when the model is done loading?
An Idea...
-
<span class="syntaxdefault">class BigBrotherAppObserver </span><span class="syntaxkeyword"><</span><span class="syntaxdefault"> Sketchup</span><span class="syntaxkeyword">;;</span><span class="syntaxdefault">AppObserver<br /> def onOpenModel</span><span class="syntaxkeyword">(</span><span class="syntaxdefault"> model </span><span class="syntaxkeyword">)<br /></span><span class="syntaxdefault"> UI</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">play_sound</span><span class="syntaxkeyword">(</span><span class="syntaxdefault"> </span><span class="syntaxstring">"hal9000.wav"</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">)<br /></span><span class="syntaxdefault"> end<br />end<br />Sketchup</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">add_observer</span><span class="syntaxkeyword">(</span><span class="syntaxdefault"> BigBrotherAppObserver</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">new </span><span class="syntaxkeyword">)<br /></span><span class="syntaxdefault"> </span>
( Doesn't work if you open a model by double-clicking a file. )
-
I'm not quite sure how to apply the code.
Paste the text into an .rb file and substitue the wav file with the one I want? didn't seem to work...@thomthom said:
<span class="syntaxdefault">class BigBrotherAppObserver </span><span class="syntaxkeyword"><</span><span class="syntaxdefault"> Sketchup</span><span class="syntaxkeyword">;;</span><span class="syntaxdefault">AppObserver<br /> def onOpenModel</span><span class="syntaxkeyword">(</span><span class="syntaxdefault"> model </span><span class="syntaxkeyword">)<br /></span><span class="syntaxdefault"> UI</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">play_sound</span><span class="syntaxkeyword">(</span><span class="syntaxdefault"> </span><span class="syntaxstring">"hal9000.wav"</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">)<br /></span><span class="syntaxdefault"> end<br />end<br /></span>
( Doesn't work if you open a model by double-clicking a file. )
-
whooops. Forgot to attach the observer... Updated the code
-
Also added an zip file with the code in a .rb file and sample audio.
-
Works Wonderfully!
Thanks ThomThom
Advertisement