Time Section Help...
-
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 -
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
-
Thanks Jim!
Advertisement