IFox.CAD.ZCAD2022 1.0.3

dotnet add package IFox.CAD.ZCAD2022 --version 1.0.3
                    
NuGet\Install-Package IFox.CAD.ZCAD2022 -Version 1.0.3
                    
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.ZCAD2022" Version="1.0.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="IFox.CAD.ZCAD2022" Version="1.0.3" />
                    
Directory.Packages.props
<PackageReference Include="IFox.CAD.ZCAD2022" />
                    
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.ZCAD2022 --version 1.0.3
                    
#r "nuget: IFox.CAD.ZCAD2022, 1.0.3"
                    
#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.ZCAD2022@1.0.3
                    
#: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.ZCAD2022&version=1.0.3
                    
Install as a Cake Addin
#tool nuget:?package=IFox.CAD.ZCAD2022&version=1.0.3
                    
Install as a Cake Tool

Fs.Fox.CAD

License AutoCAD 2019 AutoCAD 2025 中望CAD 2022 中望CAD 2025

项目简介

Fs.Fox.CAD 是基于 .NET 的 CAD 二次开发基础类库,源于 IFoxCAD 项目。

本项目在 IFoxCAD 的基础上,将命名空间改为 Fs.Fox,作为 Fs 团队 AutoCAD 开发的基础库之一。我们致力于提供稳定、易用的 CAD 二次开发解决方案,支持 AutoCAD 和中望CAD 多个版本。

主要特性

  • 🚀 多版本支持: 支持 AutoCAD 2019/2025 和中望CAD 2022/2025
  • 📦 NuGet 发布: 通过 NuGet 轻松集成到您的项目
  • 🔧 丰富的 API: 提供完整的 CAD 二次开发 API 封装
  • 📝 详细文档: 包含完整的使用文档和示例代码
  • 持续更新: 定期更新和维护,快速响应问题

官方资源

NuGet 包

本项目提供以下 NuGet 包,支持通过 GitHub Actions 自动发布。当推送版本标签时,将自动构建并发布到 NuGet.org。

包名称 版本 支持平台 .NET 框架 下载链接
IFox.CAD.ACAD2019 NuGet AutoCAD 2019 .NET Framework 4.8 下载
IFox.CAD.ACAD2025 NuGet AutoCAD 2025 .NET 8.0 下载
IFox.CAD.ZCAD2022 NuGet 中望CAD 2022 .NET Framework 4.8 下载
IFox.CAD.ZCAD2025 NuGet 中望CAD 2025 .NET Framework 4.8 下载

安装方式

使用 NuGet 包管理器
# AutoCAD 2019
Install-Package IFox.CAD.ACAD2019

# AutoCAD 2025
Install-Package IFox.CAD.ACAD2025

# 中望CAD 2022
Install-Package IFox.CAD.ZCAD2022

# 中望CAD 2025
Install-Package IFox.CAD.ZCAD2025
使用 .NET CLI
# AutoCAD 2019
dotnet add package IFox.CAD.ACAD2019

# AutoCAD 2025
dotnet add package IFox.CAD.ACAD2025

# 中望CAD 2022
dotnet add package IFox.CAD.ZCAD2022

# 中望CAD 2025
dotnet add package IFox.CAD.ZCAD2025

快速开始

基本使用示例

using Fs.Fox.CAD;
using Autodesk.AutoCAD.ApplicationServices;
using Autodesk.AutoCAD.DatabaseServices;
using Autodesk.AutoCAD.Geometry;

// 创建直线
[CommandMethod("CreateLine")]
public void CreateLine()
{
    var doc = Application.DocumentManager.MdiActiveDocument;
    var db = doc.Database;
    var ed = doc.Editor;
    
    using (var tr = db.TransactionManager.StartTransaction())
    {
        var bt = (BlockTable)tr.GetObject(db.BlockTableId, OpenMode.ForRead);
        var btr = (BlockTableRecord)tr.GetObject(bt[BlockTableRecord.ModelSpace], OpenMode.ForWrite);
        
        var line = new Line(new Point3d(0, 0, 0), new Point3d(100, 100, 0));
        btr.AppendEntity(line);
        tr.AddNewlyCreatedDBObject(line, true);
        
        tr.Commit();
    }
}

发布新版本

# 创建版本标签
git tag v1.0.0

# 推送标签到远程仓库
git push origin v1.0.0

详细说明请参考:发布工作流程文档

Fs.Fox 分支说明

项目背景

本分支在 IFoxCAD 的基础上进行了以下改进:

  • 命名空间调整: 将命名空间改为 Fs.Fox,便于 Fs 团队在生产环境中使用
  • 版本管理: 避免 DLL 版本冲突,提供更灵活的维护和开发
  • 稳定性优先: 保持 .NET Framework 4.8 支持,确保生产环境稳定性
  • 快速响应: 更快速的问题响应和功能更新

为什么选择 Fs.Fox?

  1. 生产就绪: 专为生产环境设计,稳定可靠
  2. 版本兼容: 避免 DLL 版本冲突,支持多版本共存
  3. 灵活维护: 独立维护,快速响应需求变化
  4. 持续更新: 定期更新,紧跟 CAD 平台最新版本

开发路线

当前版本

  • ✅ 支持 AutoCAD 2019/2025
  • ✅ 支持中望CAD 2022/2025
  • ✅ GitHub Actions 自动化发布
  • ✅ NuGet 包发布

许可证

本项目采用 MIT License 开源协议。

Product Compatible and additional computed target framework versions.
.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

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.3 181 10/24/2025
1.0.0 188 10/21/2025
0.0.35 197 10/21/2025
0.0.34 193 10/21/2025
0.0.31 195 10/20/2025
0.0.30 187 10/20/2025
0.0.29 194 10/20/2025
0.0.24 197 10/20/2025
0.0.23 193 10/20/2025
0.0.22 193 10/20/2025
0.0.21 189 10/20/2025
0.0.20 185 10/20/2025
0.0.16 190 10/20/2025
0.0.12 199 10/20/2025
0.0.11 189 10/20/2025
0.0.10 191 10/20/2025
0.0.8 182 10/20/2025
0.0.6 189 10/20/2025

增加CI流程支持,完善NuGet包信息