Builtin Constants and Functions
In addition to Sketchup's Ruby modules and classes, SuPy provides the
following additions to the Python builtin namespace.
Multiply by these to convert from the named unit to Sketchup's
cm, degrees, feet, inch, km,
m, mile, mm, radians, yard
Modifier Key Constants
For use by custom tool classes.
Status Bar Constants
For use with
SB_PROMPT, SB_VCB_LABEL, SB_VCB_VALUE
- Converts the given sequence to a Ruby array.
- Parses the given string as a length and returns a number,
or raises ValueError. Equivalent to the Ruby to_l method.
- keep(name, ...)
- For each name,
has been called before from
the same module with the same name, replaces the value of the name in
the calling module with the value it had at the time of the previous
This function is used to preserve the values of module-level variables
across calls to Py.refresh. It should be called from the module's
top-level code immediately after the code that initialises the
variables being preserved.
- keep_init(name, initializer)
- Like keep(name) except that on the first call the initializer is called with no arguments, and the returned value is used as the initial value. The name need not be bound in the calling module before the first call.
- Discards values previously saved using keep()for the given module. With no arguments, clears all values being kept for the specified module. With arguments, clears only the specified names.