Does anyone know of source code, ideally in C# or similar, for reading .DXF files (as used by AutoCAD etc)? If not code, then tables showing the various codes (elements / blocks / etc) and their meanings?
I am writing a reader myself, and have dead tree documentation detailing the format, but am trying to avoid writing e.g. a converter from each of the 255 ACI colours to RGB... Thanks!
Try repairing the source DWG file (see How to repair corrupt AutoCAD files). If the DXF was created by a third-party software, check the source project for file corruption, configuration, etc. and recreate the DXF. A further step could be to request the file in a different data format like DWG.
Open Adobe Illustrator. Drag and drop your DXF file into Illustrator. Click Original File Size on the Artwork Scale pop-up. The file will open and you're free to edit.
DXF files can be opened via AutoCAD. AutoCAD is a file format which is made by AutoDesk.
I have work a couple of years at developing my own DXf-Viewer in java (you could drop your own DXF file or an URL on the viewer) for 2D drawings.
The published information from AutoCAD is a good base but doesn't explain how it works.
Becoming member of the Open Design Alliance, will give you the possibility to convert several CAD formats to DXF. It may be a good idea if you are developing a commercial product.
There is a german book (http://www.crlf.de/Verlag/DXF-intern/DXF-intern.html) about DXF which really explain this format. It's expensive, but could save days of search.
The colors in the DXF Format are indexed, you must have a converter from ACI to RGB. Be careful with values 0 and 1 which having a special meaning.
Regards.
Cadlib from WoutWare have I been using for a couple of projects with good results.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With