Imports Autodesk.AutoCAD.ApplicationServices
Imports Autodesk.AutoCAD.EditorInput
Imports Autodesk.AutoCAD.Runtime
Public Class WellcomCAD
Implements IExtensionApplication
Public Sub Initialize() Implements IExtensionApplication.Initialize
MsgBox("net程序已经初始化!")
End Sub
Public Sub Terminate() Implements IExtensionApplication.Terminate
Debug.WriteLine("net程序即将销毁")
End Sub
<CommandMethod("Hello")>
Public Sub Hello()
Dim ed As Editor = Application.DocumentManager.MdiActiveDocument.Editor
ed.WriteMessage("欢迎进入cad世界!")
End Sub
End Class
这样就可以在启动net程序时做一些初始化和收尾工作,比如初始环境检测、程雪结束释放资源,相关内容写入日志等