Example #1
0
def _initialize_image_colors():
    _color = color.get_color(80, 140, 210) # blueish/purpleish
    globals.prefs['INACTIVE_LAYER_COLOR'] = _color
    _color = color.get_color(0, 0, 0) # black
    globals.prefs['BACKGROUND_COLOR'] = _color
    _color = color.get_color(255, 255, 0) # yellow
    globals.prefs['SINGLE_POINT_COLOR'] = _color
    _color = color.get_color(0, 255, 255) # cyan
    globals.prefs['MULTI_POINT_COLOR'] = _color
Example #2
0
def _initialize_styles():
    _style = graphicobject.GraphicObject.getDefaultStyle()
    globals.prefs['LINE_STYLE'] = _style
    globals.prefs['LINE_COLOR'] = _style.getColor()
    globals.prefs['LINE_TYPE'] = _style.getLinetype()
    globals.prefs['LINE_THICKNESS'] = _style.getThickness()
    #
    # set this style as the class default for the "real" drawing entities
    #
    segment.Segment.setDefaultStyle(_style)
    circle.Circle.setDefaultStyle(_style)
    arc.Arc.setDefaultStyle(_style)
    leader.Leader.setDefaultStyle(_style)
    polyline.Polyline.setDefaultStyle(_style)
    segjoint.SegJoint.setDefaultStyle(_style)
    segjoint.Chamfer.setDefaultStyle(_style)
    segjoint.Fillet.setDefaultStyle(_style)
    #
    # define and set a construction line style
    #
    _color = color.get_color(0xff, 0, 0) # red
    _lt = linetype.Linetype(u'Construction Lines', [2, 2])
    _style = style.Style(u'Construction Objects', _lt, _color, 0.0)
    conobject.ConstructionObject.setDefaultStyle(_style)
    #
    # define and add the default text style and use values in the
    # text style to define various global key/value pairs
    #
    _ts = text.TextBlock.getDefaultTextStyle()
    globals.prefs['TEXT_STYLE'] = _ts    
    globals.prefs['FONT_COLOR'] = _ts.getColor()
    globals.prefs['FONT_WEIGHT'] = _ts.getWeight()
    globals.prefs['FONT_STYLE'] = _ts.getStyle()
    globals.prefs['FONT_FAMILY'] = _ts.getFamily()
    globals.prefs['TEXT_SIZE'] = _ts.getSize()
    globals.prefs['TEXT_ANGLE'] = _ts.getAngle()
    globals.prefs['TEXT_ALIGNMENT'] = _ts.getAlignment()
    #
    # define and add the default dimension style and use the
    # values in that style to define various global preference
    # key/value pairs
    #
    _ds = dimension.Dimension.getDefaultDimStyle()
    globals.dimstyles.append(_ds)
    globals.prefs['DIM_STYLE'] = _ds
    for _key in _ds.getOptions():
        _value = _ds.getOption(_key)
        globals.prefs[_key] = _value