//替换CAD中原有命令为开发人员自己开发的命令的方法
//在CAD中执行一次RegisterMyCommand命令后,再执行line时就会loadhead程序了
[CommandMethod("RegisterMyCommand")]
public void RegisterMyCommand()
{
Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.DocumentLockModeChanged += new DocumentLockModeChangedEventHandler(RedefineCommands);
}
private void RedefineCommands(object sender, DocumentLockModeChangedEventArgs e)
{
if (e.GlobalCommandName == "LINE")
{
e.Veto();
LoadHead();
}
}
替换CAD中原有命令为开发人员自己开发的命令的方法,布布扣,bubuko.com
原文地址:http://www.cnblogs.com/swtool/p/3840173.html