@adamb said:
However, in your string_to_length(), I don't think SketchUp supports units of "km", "feet" and "mile" (though it will accept ' and " for foot and inch respectively)
These functions are primarily geared at getting input from user (via VCB or dialog box). So, even if units are not supported by SU, the notation accepts it (like the dot and comma for the decimal separator).
The functions also support the architectural notation with ' and " (though I am not fully familiar with it). For instance
s = "2'3\" + 5' 8\"" --> 2'3" + 5' 8"
Traductor.string_to_length_formula(s) --> 95.0
s = "3\" * 4" --> 3" * 4
Traductor.string_to_length_formula(s) --> 12.0
Traductor.string_to_length("1.0splishysplash") --> nil
Fredo