libdxfrw is a free C++ library to read and write DXF files in both formats ascii and binary form. It also has rudimentary capabilities to read DWG files. Note: This version of libdxfrw conflicts with librecad.Don't install both at the same time.