In normal cases you don’t get in touch with DXFTypes.
DXFList can contain every dxf drawing entity. In the usual case DXFList is used to group lines, arcs, circles and similar entities, also all composite entities (Table, MText, Rectangle) can be used. Add with append(entity) single entities to the list.
from dxfwrite import DXFEngine as dxf drawing = dxf.drawing() entities = DXFList() entities.append(dxf.line((0, 0), (10, 0))) entities.append(dxf.text('Text')) drawing.add(entities) drawing.saveas('test.dxf')
Create a basic dxf string with the default group code 1.
string = DXFString(value='VARNAME', group_code=1)
Create a basic dxf string with the default group code 2.
Create a basic dxf float with the default group code 40.
Create a basic dxf float with the default group code 50.
Create a basic dxf integer with the default group code 70.
Create a basic dxf bool (0 or 1 as integer) with the default group code 290.
Create a basic dxf point., a dxf point consist of three floats with the following group codes:
- x-coordinate – 10+index_shift
- y-coordinate – 20+index_shift
- z-coordinate – 30+index_shift
Access coordinates by the index operator:
point = DXFPoint(coords=(x, y, z), index_shift=0) x = point['x'] # or point y = point['y'] # or point z = point['z'] # or point x, y = point['xy'] x, y, z = point['xyz'] z, y, x = point['zyx']
like DXFPoint, but only x and y coordinates will be used.
like DXFPoint, but alway 3 coordinates will be used, z = 0 if omitted.