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

    Time Section Help...

    Scheduled Pinned Locked Moved Developers' Forum
    3 Posts 2 Posters 206 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.
    • T Offline
      tpoz
      last edited by

      Hello,

      I'm pretty new to Ruby and SketchUp and am trying to write a Ruby script using ShadowInfo and various other classes. My problem is that I can't find too much info on how to give all the keys a value. Some keys, like ["City"] or ["DisplayShadows"] have 'accepted' the values I gave, but my biggest prob is the ["ShadowTime"] key, it seems to not accept the time I give it and stays at Fri Nov 08 08:30:00 EST 2002.

      I have looked at some Ruby resources and used commands like Time.local or .gm, but it seems Sketchup doesn't know these because I get an error if I use them. In the Sketchup/Ruby code resources there is reference to a Time Section of which ShadowTime is in; but I can't find out what this means.

      Thanks for any help!
      tpoz

      1 Reply Last reply Reply Quote 0
      • J Offline
        Jim
        last edited by

        Hi laura,

        The 'ShadowTime' will accept a Time object.

        
        Sketchup.active_model.shadow_info['ShadowTime'] = Time.now
        
        

        You can create a new Time by using Time.mktime:

        
        # t = Time.mktime(year, month, day, hour, min, sec)
        t = Time.mktime(2009, 6, 10, 10, 5, 1)
        Sketchup.active_model.shadow_info['ShadowTime'] = t
        
        

        Hi

        1 Reply Last reply Reply Quote 0
        • T Offline
          tpoz
          last edited by

          Thanks Jim!

          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