Layer

class Layer

Layer definition, defines attribute values for entities on this layer for their attributes set to BYLAYER.

DXF Attributes for Layer

Layer.dxf.handle

DXF handle (feature for experts)

Layer.dxf.owner

requires DXF R13 or later

Layer.dxf.name

Layer name (str)

Layer.dxf.flags

Layer flags (feature for experts)

Layer.dxf.color

Layer color, but use Layer.get_color(), because color is negative for layer status off (int)

Layer.dxf.linetype

Name of line type (str)

Layer.dxf.plot

Plot flag (int)

  • 1 = plot layer (default value)
  • 0 = don’t plot layer
Layer.dxf.lineweight

Line weight in mm times 100 (e.g. 0.13mm = 13). Smallest line weight is 13 and biggest line weight is 200, values outside this range prevents AutoCAD from loading the file.

ezdxf.lldxf.const.LINEWEIGHT_DEFAULT for using global default line weight.

requires DXF R13 or later

Layer.dxf.plot_style_name

Handle to PlotStyleName (feature for experts)

requires DXF R13 or later

Layer.dxf.line_weight

requires DXF R13 or later

Layer.dxf.plot_style_name

requires DXF R13 or later

Layer.dxf.material

requires DXF R13 or later

Layer Methods

Layer.is_frozen()
Layer.freeze()
Layer.thaw()
Layer.is_locked()
Layer.lock()

Lock layer, entities on this layer are not editable - just important in CAD applications.

Layer.unlock()

Unlock layer, entities on this layer are editable - just important in CAD applications.

Layer.is_off()
Layer.is_on()
Layer.on()

Switch layer on (visible).

Layer.off()

Switch layer off (invisible).

Layer.get_color()

Get layer color, preferred method for getting the layer color, because color is negative for layer status off.

Layer.set_color(color)

Set layer color to color, preferred method for setting the layer color, because color is negative for layer status off.