官方的代码大概如下
[CommandMethod("AdskGreeting")]
public void AdskGreeting()
{
// Get the current document and database, and start a transaction
Document acDoc = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument;
Database acCurDb = acDoc.Database;
.......................................................