Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Reading .DXF files [closed]

Tags:

c#

autocad

dxf

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!

like image 475
Joel in Gö Avatar asked Jun 16 '09 11:06

Joel in Gö


People also ask

Why is my DXF file not opening?

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.

How do I open DXF files?

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.

What opens a DXF file extension?

DXF files can be opened via AutoCAD. AutoCAD is a file format which is made by AutoDesk.


2 Answers

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.

like image 61
elou Avatar answered Sep 28 '22 05:09

elou


Cadlib from WoutWare have I been using for a couple of projects with good results.

like image 39
sBENdk Avatar answered Sep 28 '22 05:09

sBENdk