• Login
sketchucation logo sketchucation
  • Login
Oops, your profile's looking a bit empty! To help us tailor your experience, please fill in key details like your SketchUp version, skill level, operating system, and more. Update and save your info on your profile page today!
⚠️ Important | Libfredo 15.6b introduces important bugfixes for Fredo's Extensions Update

How to read the measure tool values and what variable ?

Scheduled Pinned Locked Moved SketchUp Discussions
sketchup
3 Posts 3 Posters 183 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 1 Jul 2012, 06:49

    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 1 Jul 2012, 07:44

      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
      • T Offline
        TIG Moderator
        last edited by 1 Jul 2012, 11:18

        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
        1 / 1
        • First post
          1/3
          Last post
        Buy SketchPlus
        Buy SUbD
        Buy WrapR
        Buy eBook
        Buy Modelur
        Buy Vertex Tools
        Buy SketchCuisine
        Buy FormFonts

        Advertisement