draw.Drawing

Methods

Method Reference: draw.Drawing.layer

draw.Drawing: D = layer (D, NAME)

draw.Drawing: D = layer (D, NAME, Name, Value, …)

Define a layer, or set its properties.

D = layer (D, NAME) adds the layer NAME to Layers, with colour 7, line type CONTINUOUS, the output’s own pen, visible and printed; a layer already there is left as it is. Name/Value pairs set its properties, and on a layer already there they change only those given:

'Colour'
An AutoCAD colour index from 1 to 255, or a colour name accepted by draw.colour.
'Linetype'
A line type name: one of draw.linetype, or any a CAD program holds.
'LineWeight'
The width in millimetres of paper, or empty for the output’s own pen.
'Visible'
False keeps the layer and its entities but draws none of them.
'Plot'
False draws the layer on screen and leaves it off paper, for construction lines and the edge of a sheet.

An entity drawn 'byLayer', as entities are unless told otherwise, takes its colour, line type and line weight from its layer, so making a layer current is the one step that sets them all:

 
 D = draw.Drawing ('bracket');
 D = D.layer ('OUTLINE', 'LineWeight', 0.5);
 D = D.layer ('HIDDEN', 'Linetype', 'HIDDEN', 'LineWeight', 0.25);
 D.Layer = 'OUTLINE';
 D = D.circle ([0, 0], 20);
 D.Layer = 'HIDDEN';
 D = D.circle ([0, 0], 12);

See also: draw.Drawing.Layers, draw.Drawing.Layer, draw.linetype, draw.colour

Source Code: draw.Drawing