Units in the input value through the VCB
-
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) -
The API adds a
to_l
method to the standardString
class. -
Dan thanks for replying, I found a recommendation yours here
which led me to the article by thomthom
http://www.thomthom.net/thoughts/2012/08/dealing-with-units-in-sketchup/
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
Advertisement