using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Autodesk.AutoCAD.Runtime;
using Autodesk.AutoCAD.ApplicationServices;
using Autodesk.AutoCAD.EditorInput;
[assembly: ExtensionApplication(typeof(AutoLoadApplication.Initiallization))] //扩展
[assembly: CommandClass(typeof(AutoLoadApplication.Autoload))]
namespace AutoLoadApplication
{
public class Initiallization : Autodesk.AutoCAD.Runtime.IExtensionApplication //当调用类库时,自动加载执行
{
public void Initialize()
{
Editor ed = Application.DocumentManager.MdiActiveDocument.Editor;
ed.WriteMessage("自动加载,进行初始化!");
}
public void Terminate()
{
Console.WriteLine("清理!");
}
}
public class Autoload
{
[CommandMethod("Test")]
public void Test()
{
Editor ed = Application.DocumentManager.MdiActiveDocument.Editor;
ed.WriteMessage("这是一个Test命令!");
}
}
}