IFox.CAD.ACAD 0.9.12

dotnet add package IFox.CAD.ACAD --version 0.9.12
                    
NuGet\Install-Package IFox.CAD.ACAD -Version 0.9.12
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="IFox.CAD.ACAD" Version="0.9.12" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="IFox.CAD.ACAD" Version="0.9.12" />
                    
Directory.Packages.props
<PackageReference Include="IFox.CAD.ACAD" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add IFox.CAD.ACAD --version 0.9.12
                    
#r "nuget: IFox.CAD.ACAD, 0.9.12"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package IFox.CAD.ACAD@0.9.12
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=IFox.CAD.ACAD&version=0.9.12
                    
Install as a Cake Addin
#tool nuget:?package=IFox.CAD.ACAD&version=0.9.12
                    
Install as a Cake Tool

IFoxCAD 说明

基于.NET的Cad二次开发类库。

一、项目来源

起初 雪山飞狐(又狐哥) 在明经论坛发布了开源库,后来狐哥自己的项目进行了极大的丰富后形成NFox类库。然后 落魄山人 在征得 雪山飞狐的同意后,对NFox类库进行了整理,增加了注释等,重新发布了NFox类库。

后来,经过一段时间的更新后,由于莫名其妙的原因NFox类库挂掉了。而这时山人同学已经基本吃透NFox类库,考虑到NFox的封装过于复杂,遂进行了重构。

重构的类库命名为IFoxCAD, 寓意为:I(爱)Fox(狐哥),本项目发布于Inspire Function(中文名:跃动方程) 组织下,感谢 小轩轩 给起的名字。

可以加群交流:

点击链接加入群聊【IFoxCad交流群】

QQ群为丐群,所以也可以加入qq频道交流:

点击链接加入QQ频道【CAD二次开发】

二、 使用帮助

IFoxCAD的项目文档请看 IFoxCAD类库从入门到精通。

IFoxCAD的API文档请看 IFoxCAD API 文档。请注意这个网站需要科学浏览

三、IFoxCad 项目模版

目前由于IFoxCad的版本分为0.5、0.6、0.7三个大的版本同时在发布,所以项目模版分为两个主要的版本:

  • vs模版插件
  • net项目模版

建议使用net项目模版来创建项目,具体的区别可以去上面的文档里查看 4.4 IFoxCad 项目模版

四、使用IFoxCad的几种方式

目前IFoxCad的几种使用方式: 4.5 使用IFoxCad的几种方式

五、参与项目的方式

期待你的参与,你可以做如下的工作来帮助IFoxCad发展:

  • 如果你在使用的过程中发现IFoxCad的某些不足或者bug,你可以在 项目issues 里提交issue来供开发人员进行完善。
  • 帮助开发人员编写使用文档,文档地址见 IFoxCAD类库从入门到精通
  • fork本项目,修复bug,增加功能,并提交pr。
六、语言版本与编译器要求
  • 本库源码以 C# 14(.NET SDK 10)编译,使用了 C# 14 的扩展成员(extension 块与扩展属性)。
  • 调用扩展方法成员:无语言版本要求,C# 7.3 及以上均可正常调用(其编译产物与普通静态方法等价)。
  • 调用扩展属性成员:调用方需使用 C# 14 编译器(Visual Studio 2022 17.14+ 或 Visual Studio 2026);编译器版本更低时会得到 CS9202 错误。
  • 若你的项目语言版本低于 C# 14,请只使用库中的扩展方法成员,或升级 IDE/编译器。
七、第三方代码来源

本库部分功能吸收自 Apache-2.0 许可的 DYH.Extensions(分支 v10.0,其作者 DYH 亦为本库 Authors 之一)。该项目本身即基于 IFoxCAD 构建,因此这是上游作者把个人扩展件回流主库,而非跨框架移植。

逐文件来源与修改摘要、不吸收清单及其理由,见 THIRD-PARTY-NOTICES.md。

吸收红线(R0):本库不引入 CAD API 与 BCL 以外的任何第三方程序集。凡引用 Newtonsoft.Json、Mapster、DryIoc、Microsoft.Extensions.*、CommunityToolkit.*、WPF-UI 等需要额外 PackageReference 的运行时程序集的文件,无论多好用都不吸收。吸收件全部并入现有 CADShared 共享源码工程,不新建工程、不新增 NuGet 包。

据此明确不吸收的部分:服务层与 DI(Services/*、Init/*、Model/*、DYH.Extensions.DryIoc)、UI 层(DYH.Extensions.CAD.Wpf 全部)、托盘与 COM 菜单、来源许可无法判定的 Structure/QuadTree、与库内能力重复的 BoundBox2d 整套与 ObjectIdTool/RxClassTool、依赖第三方插件内核的天正 Tangent。

这意味着本库定位不变:只做 CAD 封装与扩展方法,不承担 DI 容器、序列化、对象映射、配置目录等应用宿主职责。

Product Compatible and additional computed target framework versions.
.NET net8.0-windows7.0 is compatible.  net9.0-windows was computed.  net10.0-windows was computed. 
.NET Framework net48 is compatible.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on IFox.CAD.ACAD:

Package Downloads
DYH.Extensions.CAD

Package Description

DYH.CAD.Extensions

Package Description

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.9.12 109 9/26/2026
0.9.11 109 9/12/2026
0.9.10 121 9/7/2026
0.9.9.1 327 2/24/2026
0.9.8.1 491 10/9/2025
0.9.6 585 5/24/2025
0.9.5 434 5/12/2025
0.9.4 474 4/16/2025
0.9.3 398 4/8/2025
0.9.3-preview4 344 3/12/2025
0.9.3-preview3 340 3/6/2025
0.9.3-preview2 353 3/6/2025
0.9.3-preview1 255 1/21/2025
0.9.2 409 1/21/2025
0.9.2-preview8 251 1/2/2025
0.9.2-preview7 216 1/2/2025
Loading failed

修复 DBTrans.GetTopTransaction 在目标库无事务时抛「没有顶层事务」:改为回退到事务栈顶,解决中望下外部参照块内图元取事务失败(外部参照包围盒报错)的问题;图层过滤跳过无事务的参照库。

修复 GetBlockName 在悬空块参照(块定义已删除)上抛 eWasErased:改为按打开选项自行打开块定义再读名字,并新增 openMode / openErased / openLockedLayer 参数,取不到时返回空字符串。

扩展 BlockReferenceEx(GetAttributes / GetBlockTableRecord / GetBlockName / GetNestedBlockPosition / ForEach / ChangeBlockAttribute)、XrefEx.XrefPath、HatchConverter.CreateBoundarysAndHatchToMsPs 的打开选项透传,可按需读取已删除对象或锁定图层对象。注意 ChangeBlockAttribute 为写方法,其 openMode 默认值为 ForWrite(其余均为 ForRead)。

合规:NuGet 包内随包分发 THIRD-PARTY-NOTICES.md(Apache-2.0 §4(d) 要求携带声明文件)。