模拟向命令窗口发送全图居中的命令: Application.DocumentManager.MdiActiveDocument.SendStringToExecute("z\ne\n",true,false,false);
Application.DocumentManager.MdiActiveDocument.SendStringToExecute("\u001b"+ bt.Tag+"\n",true,false,true);其中"\u001b"与取消键ESC的作用一致。
弹窗命令:
Application.ShowAlertDialog("Erase the newly added polyline.");
本例在cad画一条线并全图显示:
using Autodesk.AutoCAD.ApplicationServices;
using Autodesk.AutoCAD.DatabaseServices;
using Autodesk.AutoCAD.EditorInput;
using Autodesk.AutoCAD.Geometry;
using Autodesk.AutoCAD.Runtime;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ClassLibrary4
{
public class Class1
{
[CommandMethod("xx")]
pub