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.now
etc, see Ruby http://www.ruby-doc.org/docs/ProgrammingRuby/html/ref_c_time.html et al...
Advertisement