sketchucation logo sketchucation
    • Login
    🤑 SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

    How to read the measure tool values and what variable ?

    Scheduled Pinned Locked Moved SketchUp Discussions
    sketchup
    3 Posts 3 Posters 146 Views 3 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.
    • 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.

      1 Reply Last reply 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).

        1 Reply Last reply 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

          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