[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
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register LoginAdvertisement