sketchucation logo sketchucation
    • Login
    ⌛ Sale Ending | 30% Off Profile Builder 4 ends 30th September

    [REQ] model is loaded alarm

    Scheduled Pinned Locked Moved Plugins
    6 Posts 2 Posters 444 Views 2 Watching
    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.
    • halroachH Offline
      halroach
      last edited by

      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...

      FlexTools - Super Quick Windows, Doors, Slats...

      1 Reply Last reply Reply Quote 0
      • thomthomT Offline
        thomthom
        last edited by

        <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. )


        NotifyModelOpen.zip

        Thomas Thomassen — SketchUp Monkey & Coding addict
        List of my plugins and link to the CookieWare fund

        1 Reply Last reply Reply Quote 0
        • halroachH Offline
          halroach
          last edited by

          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. )

          FlexTools - Super Quick Windows, Doors, Slats...

          1 Reply Last reply Reply Quote 0
          • thomthomT Offline
            thomthom
            last edited by

            whooops. Forgot to attach the observer... 😳 Updated the code

            Thomas Thomassen — SketchUp Monkey & Coding addict
            List of my plugins and link to the CookieWare fund

            1 Reply Last reply Reply Quote 0
            • thomthomT Offline
              thomthom
              last edited by

              Also added an zip file with the code in a .rb file and sample audio.

              Thomas Thomassen — SketchUp Monkey & Coding addict
              List of my plugins and link to the CookieWare fund

              1 Reply Last reply Reply Quote 0
              • halroachH Offline
                halroach
                last edited by

                Works Wonderfully!
                Thanks ThomThom

                FlexTools - Super Quick Windows, Doors, Slats...

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

                Advertisement