Functions for writing DXF files

Anyone know of a library for writing Revision 12 and 13 Autocad
compatible DXF files?  My requirements for shapes are simple
(lines,circles,etc.)  Packages I've seen so far aren't R13 compatible.
    Thanks!
     Tom