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

    Units in the input value through the VCB

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

      hi all, I want to ask If at the SketchUp API
      Is there a way to interpret a length inserted through the VCB,
      as when the translation tool is used?
      for example: when the user is working on fractional inch format
      and enter something like 10 1/2 or you're working in centimeters and enter something like 15.3 cm
      my question is:
      Does the API has some input interpreter for a length or should be built?
      Thanks in advance for your help
      (google translator)

      1 Reply Last reply Reply Quote 0
      • Dan RathbunD Offline
        Dan Rathbun
        last edited by

        The API adds a to_l method to the standard String class.

        I'm not here much anymore.

        1 Reply Last reply Reply Quote 0
        • D Offline
          dacastror
          last edited by

          Dan thanks for replying, I found a recommendation yours here

          http://sketchucation.com/forums/viewtopic.php?f=180%26amp;t=55722%26amp;p=505915%26amp;hilit=units+vcb#p505915

          which led me to the article by thomthom

          http://www.thomthom.net/thoughts/2012/08/dealing-with-units-in-sketchup/

          I only have problem for receiving angles values ​​with comma as decimal separator, then I am forced to use the following

          text_input.sub!(',','.') text_input.to_f.degrees

          I do not know if there is a better method

          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