/* © Andrey Bushman, 2015
* Commands.cs
*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Rg = System.Text.RegularExpressions;
using Dr = System.Drawing;
using Fr = System.Windows.Forms;
using Wp = System.Windows;
using Wc = System.Windows.Controls;
using Cn = System.Windows.Converters;
#if AUTOCAD
using cad = Autodesk.AutoCAD.ApplicationServices.Application;
using Ap = Autodesk.AutoCAD.ApplicationServices;
using Db = Autodesk.AutoCAD.DatabaseServices;
using Ed = Autodesk.AutoCAD.EditorInput;
using Rt = Autodesk.AutoCAD.Runtime;
using Gm = Autodesk.AutoCAD.Geometry;
using Br = Autodesk.AutoCAD.BoundaryRepresentation;
using Hs = Autodesk.AutoCAD.DatabaseServices.HostApplicationServices;
using Us = Autodesk.AutoCAD.DatabaseServices.SymbolUtilityServices;
#endif
#if AUTOCAD && (PLATFORM_x64 || PLATFORM_x86)
using In = Autodesk.AutoCAD.Interop;
using Ic = Autodesk.AutoCAD.Interop.Common;
#endif
using Ex = Bushman.CAD.Extensions.AutoCAD_Net_Extension1;
[assembly: Rt.CommandClass(typeof(Ex.Commands))]
namespace Bushman.CAD.Extensions.AutoCAD_Net_Extension1 {
public sealed class Commands {
const String cmdGroup = "Bushman";
//*******************************************************************
// This is a CAD-command template. Don't forget to rename the default
// string values and method name.
[Rt.CommandMethod(cmdGroup, "test", "testx",
Rt.CommandFlags.Modal)]
public void RenameMe_Command() {
Ap.Document doc = cad.DocumentManager.MdiActiveDocument;
if (null == doc)
return;
Db.Database db = doc.Database;
Ed.Editor ed = doc.Editor;
using (doc.LockDocument()) {
using (Db.Transaction tr = db.TransactionManager.StartTransaction()) {
ed.WriteMessage("Hello, World!");
tr.Commit();
}
}
}
//*******************************************************************
}
}