netDxf 0.9.0, Copyright(C) 2014 Daniel Carvajal, Licensed under LGPL
netDxf is a .net library programmed in C# to read and write AutoCAD dxf files. It supports AutoCad2000, AutoCad2004, AutoCad2007, AutoCad2010 and AutoCad2013 dxf database versions, in both text and binary format.
I tried to keep the use as simple as posible, for example you will not need to fill up the table section with layers, styles or line type definitions. The DxfDocument will take care of that everytime a new item is added and the load and save its done with just
one line of code.
If you need more information, you can find the official dxf documentation in
public static void Main()
// by default it will create an AutoCad2000 dxf version
DxfDocument dxf = new DxfDocument();
// add your entities here
// save to file
// load file
DxfDocument dxfLoad = DxfDocument.Load(filename);
Samples and Demos
Are contained in the source code.
Well, at the moment they are just tests for the work in progress.
Dependencies and distribution
To compile netDxf you need:
- Dimensions (aligned, linear, radial, diametric, 3 point angular, 2 line angular, and ordinate)
- Hatch (including Gradient patterns)
- Insert (block references and attributes)
- LwPolyline (light weight polyline)
- XLine (aka construction line)
The dimension style definition is very limited and the drawing might be buggy under some circunstances (it is sensitive in the order the reference points are given and/or offset negative values).
All entities can be grouped and may contain extended data information.
The libray will never be able to read some entities like Regions and 3dSolids, since they depend on proprietary data.