Skip to main content

Module dxf

Module dxf 

Source
Expand description

ASCII DXF import and export.

Import supports LINE, LWPOLYLINE (bulges), 2D POLYLINE/VERTEX (bulges), CIRCLE, ARC, TEXT, MTEXT (formatting stripped), POINT and the LAYER table, for AC1009 (R12) through AC1032 (2018). Units come from $INSUNITS (unitless files are read as millimetres and reported). Entities with an extrusion of (0, 0, -1) are mirrored correctly; other OCS orientations are reported. INSERT, HATCH, SPLINE, ELLIPSE, DIMENSION and every other entity are counted in the report — never dropped silently. Binary DXF is rejected. Text decoding: UTF-8 (AC1021+), otherwise $DWGCODEPAGE ANSI_1252/ANSI_1254 plus \U+XXXX escapes.

Export writes R12 (AC1009) ASCII — the most widely readable variant — with LINE, POLYLINE/VERTEX (bulges), CIRCLE, ARC, TEXT and POINT, layers and $INSUNITS = 4 (mm). Béziers are flattened and reported.

Structs§

DxfImport
Imported layers and entities.

Enums§

DxfError
DXF errors.

Constants§

MAX_DXF_BYTES
Maximum DXF input size.

Functions§

export_dxf
Export the engine’s committed document as R12 ASCII DXF (mm).
import_dxf
Import ASCII DXF bytes.