网站开发流程框架网站作品怎么做
课程目标:本节课教大家如何搭建基于VS2022 + AutoCAD2021的开发环境,同时编写第一个CAD二次开发命令。
第一步:安装好上述2款软件其中AutoCAD2021略,VS2022下载地址如下:Thank You for Downloading Visual Studio Professional Edition
https://visualstudio.microsoft.com/zh-hans/thank-you-downloading-visual-studio/?sku=Professional&channel=Release&version=VS2022&source=VSLandingPage&cid=2030&passive=false
第二步:创建软件工程项目

 

第三步:添加引用

 

 
 


第四步:在class.cs文件中编写好命令并编译项目

using Autodesk.AutoCAD.ApplicationServices.Core;
using Autodesk.AutoCAD.Runtime;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;namespace 搭建环境
{public class Class1{[CommandMethod("THW")]public  static void TestHelloWord() {Application.DocumentManager.MdiActiveDocument.Editor.WriteMessage("HelloWord!!!");      }}
}
 
 
 
 
第五步:测试程序
 1)在cad命令栏键入netload并回车
2)键入生成的dll文件路径


3)在命令行键入刚才编写的命令"THW"并回车

 
