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