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

          Link Preview Image
          Dealing with Units in SketchUp

          There are extensions to the base classes in SketchUp’s Ruby API which often new SketchUp plugin developers overlook. If you aren’t aware of them you might find yourself reinventing many…

          favicon

          Procrastinators Revolt! (www.thomthom.net)

          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