Quick and nasty:
using System;
using Autodesk.AutoCAD.ApplicationServices;
using Autodesk.AutoCAD.DatabaseServices;
using Autodesk.AutoCAD.EditorInput;
using Autodesk.AutoCAD.Runtime;
using acadApp = Autodesk.AutoCAD.ApplicationServices.Application;
[assembly: CommandClass(typeof(BrycoLastAng.tcgsCommands))]
namespace BrycoLastAng {
/// <summary>
/// Summary description for tcgsCommands.
/// </summary>
public class tcgsCommands {
public tcgsCommands() {
//
// TODO: Add constructor logic here
//
}
// Define Command "AsdkCmd1"
[CommandMethod("BrycoLastAngle")]
static public void brycolastanglecommand() // This method can have any name
{
Document doc = acadApp.DocumentManager.MdiActiveDocument;
Database db = doc.Database;
Editor ed = doc.Editor;
double lastAngle = (double)acadApp.GetSystemVariable("LASTANGLE");
ed.WriteMessage("\nValue of 'LASTANGLE' system variable: {0}", lastAngle);
}
}
}
Cheers,
Glenn in UK.