draw_labels

compas_rhino.utilities.draw_labels(labels, **kwargs)[source]

Draw labels as text dots and optionally set individual font, fontsize, name, layer and color.

Parameters

labels (list[dict]) – A list of labels dictionaries. See Notes, for more information about the structure of the dict.

Returns

list[System.Guid]

Notes

A label dict has the following schema:

Schema({
    'pos': And(list, lambda x: len(x) == 3),
    'text': And(str, len),
    Optional('name', default=''): str,
    Optional('color', default=None): (lambda x: len(x) == 3 and all(0 <= y <= 255 for y in x)),
    Optional('layer', default=None): str,
    Optional('fontsize', default=10): Or(int, float),
    Optional('font', default="Arial Regular"): str
})