Login  Register

DXF file import

Posted by ike on May 20, 2014; 5:19am
URL: https://forum.librecad.org/DXF-file-import-tp5709940.html

Long time ago I built routine to import dxf files. It was done in vb6. Worked good but it does not read dimensions and splines.

There is a lot people dealing with DXF, and it would be nice if you can build DXF routines as separate library.
with wrapper in C, so other programming languages like python, freebasic, D ... can link it

and for some easy use a function that translate DXf into txt file that is even human readable:

translate("a.dxf", "a.txt")

A.TXT sample
LAYER_START nameofthelayer
BLOCK_START
LINE x1=10.222 y1=22.44 x2=44.67 y2=76.77 colorRGB=128,0,0 width=2 style=DASHDOT
POLYLINE_START colorRGB=128,0,0 width=2 style=DASHDOT
LINE x1=10.222 y1=22.44 x2=44.67 y2=76.77
LINE x1=44.67 y1=76.77 x2=144.67 y2=176.77
POLYLINE_END
BLOCK_END
LAYER_END

And also I think you should have LibreCAD native format as binary LCB and text LCT

Regards,

IKE