Ruby API Documentation - Errors & Suggestions

Agreed.

I’d like to see view locked notes as a subclass of Sketchup::Text with the added methods it needs, and the useless ones from the superclass undefined for the subclass.

Names for the class could be ViewNote or TextNote.

(I prefer the former as it indicates the anchoring to the viewport.)

Additional methods needed might contain:

#anchor : Return an array of the position scales [ x_scale, y_scale ] from the upper left corner of the viewport. (The scales being a Float between 0.0 and 1.0.)

#anchor= : Accepts an array of the position scales [ x_scale, y_scale ] from the upper left corner of the viewport. (The scales being a Float between 0.0 and 1.0.) Cause an undo entry.

#set_anchor : Accepts an array or a list of two values, of the position scales [ x_scale, y_scale ] from the upper left corner of the viewport. (The scales being a Float between 0.0 and 1.0.) Should not cause an undo entry.

(Currently in order to move a note, we have to save it’s text, erase it, and recreate it. This causes an undo entry.)

#outline
#outline= : thickness of outline (0 if none), unit (:em,:px, etc.)

#padding
#padding= : thickness of padding (use nil for default in setter.), unit (:em,:px, etc.)

#background
#background= : Sketchup::Material object (nil if none.) Would allow transparency.

#color
#color= : Sketchup::Color object (nil if default.)

#font : reference to font object to get & set face, style & size (and choose between pts & %, or assume % if value is Float between 0.0 and 1.0 ?)


EDIT (2019-02-19) : Added an issue to the official API issue tracker at GitHub …

2 Likes