zoukankan      html  css  js  c++  java
  • NetDxf 开发笔记-01

    netdxf介绍github库

    https://github.com/haplokuon/netDxf

    netDxf是一个.net库,用C语言编程,用于读取和写入AutoCAD DXF文件。它支持文本和二进制格式的AutoCad2000、AutoCad2004、AutoCad2007、AutoCad2010、AutoCad2013和AutoCAD2018DXF数据库版本。
    这个库很容易使用,我尽量使过程简单明了,例如,您不需要用图层、样式或线型定义填充表格部分。每次添加新项时,DxfDocument都会处理这个问题。

    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.AddEntity(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);
    }
    

      支持的实体

    • 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)

    所有实体都可以分组。所有DXF对象都可能包含扩展数据信息。AutoCad表格图元将作为插入(块参照)导入。支持简单线型和复杂线型。库永远无法读取某些实体,如面域、曲面和三维实体,因为它们依赖于未记录的专有数据。

  • 相关阅读:
    jieba分词
    hue审计记录-记录用户的查询记录(用户前端删除,后端也不会删除)
    nginx1.16.1平滑升级到1.18
    mysql5.7.24升级到5.7.30 rpm部署模式 redhat7
    ldap无法启动 system library:fopen:Permission denied bss_file.c:402
    hive练习-行列转换 窗口函数
    linkis重编译适配cdh
    redhat7 安装mysql5.15
    hive 自动加载分区 --动态分区
    最近搞了个客户端
  • 原文地址:https://www.cnblogs.com/NanShengBlogs/p/14584807.html
Copyright © 2011-2022 走看看