netDxf Namespace |
Base objects and hi-level classes for document load/save
| Class | Description | |
|---|---|---|
| AciColor |
Represents an ACI color (AutoCAD Color Index) that also supports true color.
| |
| BoundingRectangle |
Represents an axis aligned bounding rectangle.
| |
| ClippingBoundary | ||
| DxfDocument |
Represents a document to read and write DXF files.
| |
| DxfObject |
Represents the base class for all DXF objects.
| |
| DxfObjectCode |
Dxf string codes.
| |
| MathHelper |
Utility math functions and constants.
| |
| StringEnum |
Helper class for working with 'extended' enums using StringValueAttribute attributes.
| |
| StringValueAttribute |
Simple attribute class for storing String Values
| |
| Symbols |
Symbols for dxf text strings.
| |
| Transparency |
Represents the transparency of a layer or an entity.
| |
| XData |
Represents the extended data information of an entity.
| |
| XDataRecord |
Represents an entry in the extended data of an entity.
|
| Structure | Description | |
|---|---|---|
| Matrix3 |
Represents a 3x3 double precision matrix.
| |
| Vector2 |
Represent a two component vector of double precision.
| |
| Vector3 |
Represent a three component vector of double precision.
|
| Enumeration | Description | |
|---|---|---|
| ClippingBoundaryType |
Image clipping boundary type.
| |
| CoordinateSystem |
Defines the coordinate system reference.
| |
| Lineweight |
Represents the line weight of a layer or an entity.
| |
| XDataCode |
Defines the extended data code.
|
The most relevant classes in the namespace
1 public static void Main() 2 { 3 // your dxf file name 4string file = "sample.dxf"; 5 // by default it will create an AutoCad2000 DXF version 6 DxfDocument dxf = new DxfDocument(); 7 // an entity 8 Line entity = new Line(new Vector2(5, 5), new Vector2(10, 5)); 9 // add your entities here 10 dxf.AddEntity(entity); 11 // save to file 12 dxf.Save(file); 13 bool isBinary; 14 // this check is optional but recommended before loading a DXF file 15 DxfVersion dxfVersion = DxfDocument.CheckDxfFileVersion(file, out isBinary); 16 // netDxf is only compatible with AutoCad2000 and higher DXF version 17 if (dxfVersion{DxfVersion.AutoCad2000}) return; 18 // load file 19 DxfDocument loaded = DxfDocument.Load(file); 20 }