Stani’s DXF library for python is an excellent tool for writing lines, circles, and polygons in DXF format. DXF (Document Exchange Format) is an ASCII file format published by AutoCad which can be read by a variety of programs, including Blender, Maya, CorelDraw, and a host of others.
I’ll attempt to document the library here as I figure it out, and also release updates to it as I slowly add more element types. I’m learning python and the DXF format as I go along so I can’t guarantee that any of this is correct.
Changes in 1.1.1
- Added support for LWPOLYLINE, so you can now make a continuous polyline instead of several separate lines
This will draw a line from (0,0) to (1,1) and “Hello World” at (3,0)
#set the color of the text layer to green
#add drawing elements