I use Sketchup in metric(mm) mode and am writing ruby script but there appears to be an error in the calculation of p2 from the offset of p1 in the following example
Sketchup always uses inches internally. When reporting lengths, however, it may present them with units attached.
Looks as if the v1 variable is just reporting internal units (not a length) whereas p1 and p2 are reporting lengths in whatever units you have set in model info - mm in this case.
[Notice I do not use parenthesis with puts(). This is because global methods defined in class Object, and module Kernel (which is mixed into Object,) are considered to have keyword status. This is called a style guideline. Parenthesis can still be used when the argument list is complex or spans several lines, etc. Ie, it’s not a hard and fast rule. Readability is paramount.]