Download source files - 16 Kb

This article demonstrate how to write an ASCII DXF files. A DXF file
is a file composed of sections and associated values. They are read by
AutoCad and then converted to a drawing.
I have developped a class CDxf to write a DXF file from an application.
Then the user must use AutoCad to interpret the DXF file.
I have included only a small portion of what can be do with DXF files.
All the details are contained in the following document from the AutoDesk
web site : http://www.autodesk.com/techpubs/autocad/dxf/.
void CDxf::Circle ()
{
ofstream FichierDxf ("TestDxf.dxf", ios::app);
FichierDxf << 0 << endl;
FichierDxf << "CIRCLE" << endl;
FichierDxf << 8 << endl;
FichierDxf << 0 << endl;
FichierDxf << 10 << endl;
FichierDxf << 0.0 << endl;
FichierDxf << 20 << endl;
FichierDxf << 0.0 << endl;
FichierDxf << 30 << endl;
FichierDxf << 0.0 << endl;
FichierDxf << 40 << endl;
FichierDxf << 500.0 << endl;
FichierDxf.close();
}
By being able to write a DXF file, I can integrate into my applications a
way to share information with AutoCad. Obviously there is a lot more that can
be added to this class.