How to read the measure tool values and what variable ?
-
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.
-
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).
-
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...
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better π
Register LoginAdvertisement