1 Star 0 Fork 1

sounamu / netDxf

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

netDxf

netDxf Copyright(C) 2009-2021 Daniel Carvajal, licensed under MIT License

Description

netDxf is a .net library programmed in C# to read and write AutoCAD DXF files. It supports AutoCad2000, AutoCad2004, AutoCad2007, AutoCad2010, AutoCad2013, and AutoCad2018 DXF database versions, in both text and binary format.

The library is easy to use and I tried to keep the procedures as straightforward as possible, 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 every time a new item is added.

If you need more information, you can find the official DXF documentation here.

Code example:

public static void Main()
{
	// your DXF file name
	string file = "sample.dxf";

	// create a new document, by default it will create an AutoCad2000 DXF version
	DxfDocument doc = new DxfDocument();
	// an entity
	Line entity = new Line(new Vector2(5, 5), new Vector2(10, 5));
	// add your entities here
	doc.Entities.Add(entity);
	// save to file
	doc.Save(file);

	// this check is optional but recommended before loading a DXF file
	DxfVersion dxfVersion = DxfDocument.CheckDxfFileVersion(file);
	// netDxf is only compatible with AutoCad2000 and higher DXF versions
	if (dxfVersion < DxfVersion.AutoCad2000) return;
	// load file
	DxfDocument loaded = DxfDocument.Load(file);
}

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

Multitarget project, predefined frameworks for Net Framework 4.5, Net Standard 2.1, Net Core 3.1, and NET 5.0.

Compiling

Visual Studio 2019.

Development Status

See changelog.txt or the wiki page for information on the latest changes.

Supported entities

  • 3dFace
  • Arc
  • Circle
  • Dimensions (aligned, linear, radial, diametric, 3 point angular, 2 line angular, and ordinate)
  • Ellipse
  • Hatch (including Gradient patterns)
  • Image
  • Insert (block references and attributes)
  • Leader
  • Line
  • LwPolyline (light weight polyline)
  • Mesh
  • MLine
  • MText
  • Point
  • PolyfaceMesh
  • Polyline
  • Ray
  • Shape
  • Solid
  • Spline
  • Text
  • Tolerance
  • Trace
  • Underlay (DGN, DWF, and PDF underlays)
  • Wipeout
  • XLine (aka construction line)

All entities can be grouped. All DXF objects may contain extended data information. AutoCad Table entities will be imported as Inserts (block references). Both simple and complex line types are supported. The library will never be able to read some entities like REGIONs, SURFACEs, and 3DSOLIDs, since they depend on undocumented proprietary data.

MIT License Copyright (c) 2021 Daniel Carvajal Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

暂无描述 展开 收起
C# 等 2 种语言
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
C#
1
https://gitee.com/sounamu/netDxf.git
git@gitee.com:sounamu/netDxf.git
sounamu
netDxf
netDxf
master

搜索帮助