Getting the Current Date with SketchUp Ruby API
-
Hi everyone,
I was just wondering if anyone could help me find a way of getting the current date using the SketchUp API. It appears that the SketchUp API does not have access to the Ruby Date class. I was just wondering if anyone has come up against this issue before and found a workaround?
I suppose one way would be to import the Ruby standard date class into my plugin, but I've no idea what other dependencies are on that....
Any help would be most appreciated.
Best Regards,
Malcolm Murray -
OK, figured this out and have it working.
Just have to add the date.rb, Date folder and rational.rb files from the Ruby Core files to the plugin and it works perfectly.

-
Built into core Ruby already...
Time.nowetc, see Ruby http://www.ruby-doc.org/docs/ProgrammingRuby/html/ref_c_time.html et al...
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