using System; using System.Collections; using System.Collections.Generic; using System.Windows.Forms; // AutoCAD Specific using Autodesk.AutoCAD.DatabaseServices; using Autodesk.AutoCAD.Runtime; using Autodesk.AutoCAD.Geometry; using Autodesk.AutoCAD.ApplicationServices; using Autodesk.AutoCAD.EditorInput; using AcadApp = Autodesk.AutoCAD.ApplicationServices.Application; using DatabaseServ = Autodesk.AutoCAD.DatabaseServices; using TransMan = Autodesk.AutoCAD.DatabaseServices.TransactionManager; [assembly: ExtensionApplication(typeof(CLDesign.CLDesignExtApp))] namespace CLDesign { public class CLDesignExtApp : IExtensionApplication { public static CLDwgManager CLAppDwgMan; public void Initialize() { CLAppDwgMan = new CLDwgManager(); AcadApp.SystemVariableChanged += new Autodesk.AutoCAD.ApplicationServices.SystemVariableChangedEventHandler(AcadApp_SystemVariableChanged); } public void Terminate() { CLAppDwgMan.Release(); AcadApp.SystemVariableChanged -= new Autodesk.AutoCAD.ApplicationServices.SystemVariableChangedEventHandler(AcadApp_SystemVariableChanged); } private void AcadApp_SystemVariableChanged(Object sender, Autodesk.AutoCAD.ApplicationServices.SystemVariableChangedEventArgs e) { if (e.Name == "CVPORT") { Document doc = AcadApp.DocumentManager.MdiActiveDocument; Editor editor = doc.Editor; editor.WriteMessage("\n{0} = {1}", e.Name, AcadApp.GetSystemVariable(e.Name)); } } } // END CLASS }