sketchucation logo sketchucation
    • Login
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info

    Getting the Current Date with SketchUp Ruby API

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

      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

      1 Reply Last reply Reply Quote 0
      • M Offline
        mocathe1st
        last edited by

        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. 😄

        1 Reply Last reply Reply Quote 0
        • TIGT Offline
          TIG Moderator
          last edited by

          Built into core Ruby already...

          Time.now

          etc, see Ruby http://www.ruby-doc.org/docs/ProgrammingRuby/html/ref_c_time.html et al...

          TIG

          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