|
SketchUp Ruby API Reference |
The String class contains a method used to parse a string as a length value.
Parent: Object
Methods: to_l
Example Code: stringtests.rb
The to_l method is used to parse a string and returns a length value.
length = str.to_l
length - a length value in current units if successful
teststring = "3.2m"
begin
len = teststring.to_l
rescue
UI.messagebox $!.message
end
if (len)
UI.messagebox len
else
UI.messagebox "Failure"
end