WfunCharp.CustomEnt.Arch
1.0.10
dotnet add package WfunCharp.CustomEnt.Arch --version 1.0.10
NuGet\Install-Package WfunCharp.CustomEnt.Arch -Version 1.0.10
<PackageReference Include="WfunCharp.CustomEnt.Arch" Version="1.0.10" />
<PackageVersion Include="WfunCharp.CustomEnt.Arch" Version="1.0.10" />
<PackageReference Include="WfunCharp.CustomEnt.Arch" />
paket add WfunCharp.CustomEnt.Arch --version 1.0.10
#r "nuget: WfunCharp.CustomEnt.Arch, 1.0.10"
#:package WfunCharp.CustomEnt.Arch@1.0.10
#addin nuget:?package=WfunCharp.CustomEnt.Arch&version=1.0.10
#tool nuget:?package=WfunCharp.CustomEnt.Arch&version=1.0.10
WfunCharpCustomEnt
这个包可以帮助cad二次开发人员快速的用C#实现自定义实体实体,不需要学习复杂的C++, 样例代码仓库 由于本包内部使用了C++,所以需要严格版本对应,具体对应关系:
| net版本 | 对应CAD版本 | Rx版本 |
|---|---|---|
| net35 | 2010 | R18 |
| net40 | 2013-2014 | R19 |
| net45 | 2015-2016 | R20 |
| net46 | 2017 | R21 |
| net461 | 2018 | R22 |
| net47 | 2019-2020 | R23 |
| net48 | 2021-2024 | R24 |
<img width="248" height="153" alt="image" src="https://github.com/user-attachments/assets/08505e46-d190-4b01-b785-61dfdd415b3f" />
仅支持x64,32位暂未有支持计划
目前支持的cad版本:
- Cad2010
- Cad2011
- Cad2012
- Cad2013
- Cad2014
- Cad2015
- Cad2016
- Cad2017
- Cad2018
- Cad2019
- Cad2020
- Cad2021
- Cad2022
- Cad2023
- Cad2024
- Cad2025
- Cad2026
浩辰CAD版本
- zwCad2024
- zwCad2025
- zwCad2026
中望AD版本
- gsCad2024
- gsCad2025
- gsCad2026
支持的自定实体功能
1.自定义数据归档
protected override void SubDataOut(DataIO data) { base.SubDataOut(data); DataIO dataThis = new DataIO(); // dataThis.SetData(value); data.SetData(dataThis); } protected override void SubDataIn(DataIO data) { base.SubDataIn(data); DataIO dataThis = data.GetData(); // dataThis.GetData(ref value); }
2.自定义绘制
protected override bool SubDraw(DrawEnt mode) { mode.Draw(new Circle() {Center = Center, Radius = Radius }); return true; }
3.自定义打印信息到命令行
protected override void SubEntList() { ed.WriteMessage($"\n 半径:{Radius}"); }
3.自定义矩阵变换
protected override bool SubEntTransformBy(Matrix3d xform) { Center = Center.TransformBy(xform); return true; }
4.自定义夹点
protected override bool SubEntGetGripPoints(List<Point3d> gripPts) { gripPts.Add(Center); return true; } protected override bool SubEntSetGripPoints(Vector3d offset, int nIndex) { if (0 == nIndex) { Center = Center + offset; } return true; }
其他注意事项参考样例工程
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET Framework | net35 is compatible. net40 is compatible. net403 was computed. net45 is compatible. net451 was computed. net452 was computed. net46 is compatible. net461 is compatible. net462 was computed. net463 was computed. net47 is compatible. net471 was computed. net472 was computed. net48 is compatible. net481 was computed. |
This package has no dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
2025年9月29日:解决bug:#3:无法将引用添加到“WfunCharpCustomEntArx_