sketchucation logo sketchucation
    • Login
    🛣️ Road Profile Builder | Generate roads, curbs and pavements easily Download

    How to read the measure tool values and what variable ?

    scheduled pinned locked moved SketchUp Discussions
    sketchup
    3 Posts 3 Posters 167 Views 3 Watching
    loading-more-posts
    • oldest-to-newest
    • newest-to-oldest
    • most-votes
    reply
    • reply-as-topic
    guest-login-reply
    deleted-message
    • Y Offline
      youthreewire
      last edited by

      Hi,

      I have a query regarding the measure tool. The measure tool as you know is for measuring the distance between tow points. Now I want to know in which variable is it stored and if more than one what is the variable array for it? I want to read it through code in Ruby. Please let me know.

      one-reply-to-this-post last-reply-time reply quote 0
      • A Offline
        Aerilius
        last edited by

        It is stored in "no" variable that could be accessible with Ruby. The native measurements tool is not written in Ruby but in C code and the only linkage between SketchUp's internal C code and Ruby are the methods of the Ruby API.
        Even if we had access to the C code objects, it depends on the variable scope whether the measurements tool exposes its internal methods and variables.

        Sometimes a solution is to rebuild a native tool with Ruby (or only the part that you need).

        one-reply-to-this-post last-reply-time reply quote 0
        • TIGT Offline
          TIG Moderator
          last edited by

          Look at the linetool.rb example that ships with Sketchup.
          All you need to do is use the two picked points and length=point1.distance(point2) without drawing the line at all.
          You can then 'format' the result as desired...

          TIG

          one-reply-to-this-post last-reply-time 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