開發(fā)環(huán)境
中望CAD版本:2021
VS版本:2015
1.創(chuàng)建類庫(kù)項(xiàng)目
.NET Framework4.7
2.添加類庫(kù)
ZwDatabaseMgd.dll
ZwManaged.dll
這兩個(gè)DLL位于中望CAD安裝目錄下,復(fù)制本地屬性改為False
3.導(dǎo)入命名空間
using ZwSoft.ZwCAD.Runtime;
using ZwSoft.ZwCAD.ApplicationServices;
using ZwSoft.ZwCAD.DatabaseServices;
using ZwSoft.ZwCAD.EditorInput;
4.定義命令
[CommandMethod("ZZZ")]
public void ZZZ()
{
DocumentCollection docs = Application.DocumentManager;
Document doc = docs.MdiActiveDocument;
Editor ed = doc.Editor;
Database db = doc.Database;
ed.WriteMessage("歡迎使用中望CAD");
}
5.編譯程序
6.啟動(dòng)中望cad
7.在命令行中輸入ZZZ蚓让,命令行中會(huì)顯示“歡迎使用中望CAD”
最后編輯于 :
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者