sketchucation logo sketchucation
    • Login
    โ„น๏ธ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info

    Sketchup clock/time

    Scheduled Pinned Locked Moved Newbie Forum
    sketchup
    16 Posts 6 Posters 3.3k Views 6 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.
    • M Offline
      mp1963
      last edited by

      I know this has most likely been covered already but my Sketup Pro 8 date and time sliders always default to 11/08 and 1:30pm .. What I would like is to have my system time and date there instead. I have looked through the preferences and can't find a way to do this. Am I missing something really fundamental (most likely!) or is this "just how it is" ?

      1 Reply Last reply Reply Quote 0
      • TIGT Offline
        TIG Moderator
        last edited by

        It seems like a daft idea to me but...
        Here goes...
        You shadow settings location/date/time use whatever is set in the template for a new SKP, or what was last set in a SKP when it was saved...
        You can also change all/some of those values 'in code', but you'd need a script that, either ran as the SKP opened [which I don't recommend because it'd be annoying if you had set your location or shadows etc up in a SKP for a particular place/day/time but Sketchup automatically changed it to 'today/now' every time you opened the SKP ๐Ÿ˜’ ]; or, a much better idea, is a Plugins menu item called something like ' Today's Date+Time' [that leaves the current 'location' alone but lets you change the day/time to 'now' for your own weird reasons].
        All you need is this short line of code
        Sketchup.active_model.shadow_info["ShadowTime_time_t"]=Time.now.to_i
        Copy/paste it +<enter> into the Ruby Console to see what it does...
        To make a simple Plugins menu item [to which you can then shortcut if you must] you can use this short block of code inside a new file in the Plugins folder named say #Timenow.rb - use Notepad.exe or a similar plain-text editor to make it.

        require 'sketchup.rb'
        unless file_loaded?(File.basename(__FILE__))
          UI.menu("Plugins").add_item("Date|Time Now"){
            Sketchup.active_model.shadow_info["ShadowTime_time_t"]=Time.now.to_i
          }
        end
        file_loaded(File.basename(__FILE__))
        

        Save and restart Sketchup to get the new menu item available [note how starting the file-name with a '#' means it'll load early and appear near the start of the Plugins menu items].
        ๐Ÿค“

        TIG

        1 Reply Last reply Reply Quote 0
        • M Offline
          mp1963
          last edited by

          Awesome. I accept you think I am a bit strange.. I figured that out a long time ago ๐Ÿ˜„ Thanks for the advice and the script!

          1 Reply Last reply Reply Quote 0
          • Dave RD Offline
            Dave R
            last edited by

            Interesting. It'll be a lot of fun to work in SketchUp after sunset. ๐Ÿ˜†


            Night.png

            Etaoin Shrdlu

            %

            (THERE'S NO PLACE LIKE)

            G28 X0.0 Y0.0 Z0.0

            M30

            %

            1 Reply Last reply Reply Quote 0
            • TIGT Offline
              TIG Moderator
              last edited by

              Hence my comments about its 'daftness'... ๐Ÿ˜ฒ
              BUT as I show it readily IS possible to do it ! ๐Ÿ‘Š

              TIG

              1 Reply Last reply Reply Quote 0
              • mitcorbM Offline
                mitcorb
                last edited by

                In other words this modifies lighting in the scene?

                I take the slow, deliberate approach in my aimless wandering.

                1 Reply Last reply Reply Quote 0
                • TIGT Offline
                  TIG Moderator
                  last edited by

                  It sets the SKP's day/time to match the PC's System day/time at the very moment you run the tool [ Time.now.to_i].
                  It uses the SKP's current location.
                  Assuming your SKP is geo-referenced to somewhere near where you are viewing it, then running the tool 'at night' [i.e. on average about 50% of the time] it will mean that you can't see any geometry etc !
                  If the model is located elsewhere then it's even more complicated ?
                  Setting your SKP's day/time to match 'now' seems daft to me...
                  I only supply the code I don't attest to its logic !
                  ๐Ÿ˜Ž

                  TIG

                  1 Reply Last reply Reply Quote 0
                  • irwanwrI Offline
                    irwanwr
                    last edited by

                    Honestly sir,
                    I really admire and use some of your magical wizard plugins indeed.
                    I think this one is the first exception, since I often draw things after 18:00 ๐Ÿ˜†

                    1 Reply Last reply Reply Quote 0
                    • M Offline
                      mp1963
                      last edited by

                      Perhaps its just me being rather weird again but surely this time change only affects what you see when you render ? I has no effect whatsoever on what I see when I am drawing in the editor. So why is this such a daft idea ?

                      Interestingly the suggested script yields:

                      Error Loading File #TimeNow.rb
                      /Library/Application Support/Google SketchUp 8/SketchUp/Plugins/#TimeNow.rb:6: parse error, unexpected $, expecting kEND
                      file_loaded(File.basename(FILE))

                      1 Reply Last reply Reply Quote 0
                      • Dave RD Offline
                        Dave R
                        last edited by

                        Look at my screen shot. How would you feel about drawing in SketchUp when your model looks like that? Personally I would find it difficult.

                        Etaoin Shrdlu

                        %

                        (THERE'S NO PLACE LIKE)

                        G28 X0.0 Y0.0 Z0.0

                        M30

                        %

                        1 Reply Last reply Reply Quote 0
                        • TIGT Offline
                          TIG Moderator
                          last edited by

                          Marek

                          Sorry about that ! ๐Ÿ˜’
                          I made a silly typo in the code [I missed out the 'end' statement]
                          I've corrected the code in the earlier post...
                          Retry it...

                          TIG

                          1 Reply Last reply Reply Quote 0
                          • irwanwrI Offline
                            irwanwr
                            last edited by

                            Hi Marek,

                            Just want you to know, I found this [Plugin] Put shadow on current day and hour in the plugin index by accident.
                            Not really accident, was checking on Matthew's plugins beside Toggle Unit.

                            so, now there are two scripts or plugins about shadow's issue? ๐Ÿ˜›

                            1 Reply Last reply Reply Quote 0
                            • M Offline
                              mp1963
                              last edited by

                              Now I don't feel quite so mad anymore and I hope all those people who declared me insane ๐Ÿ˜ฎ will give me a reprieve ๐Ÿ˜•

                              1 Reply Last reply Reply Quote 0
                              • TIGT Offline
                                TIG Moderator
                                last edited by

                                Like a reverse vampire you can only do your Sketchup modeling during the hours of daylight ๐Ÿ˜‰

                                TIG

                                1 Reply Last reply Reply Quote 0
                                • Rich O BrienR Offline
                                  Rich O Brien Moderator
                                  last edited by

                                  And you'll like garlic and sleeping in a maternity ward?

                                  Download the free D'oh Book for SketchUp ๐Ÿ“–

                                  1 Reply Last reply Reply Quote 0
                                  • M Offline
                                    mp1963
                                    last edited by

                                    Funny you should say that.... ๐Ÿ‘ฟ

                                    I still don't understand what TIG means about only doing my Sketchup modelling during daylight hours ? The wierdo mad script to set the shadow clock to real time has no effect (on my iMac) to the Sketchup editor.. it doesn't go dark, I don't see glorious sunsets or sunrises... ๐Ÿคฃ

                                    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