zoukankan      html  css  js  c++  java
  • 【AutoCAD.NET】程序的初始化和终止化清理工作

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using Autodesk.AutoCAD.ApplicationServices;
    using Autodesk.AutoCAD.Runtime;
    using Autodesk.AutoCAD.EditorInput;
    
    namespace InitAndOpt
    {
        public class InitClass : IExtensionApplication
        {
            //程序的初始化
            public void Initialize()
            {
                Editor ed = Application.DocumentManager.MdiActiveDocument.Editor;
                //在AutoCAD命令行载入信息,它们会在程序载入时显示
                ed.WriteMessage("程序开始初始化");
            }
    
            //程序的终止化清理工作
            public void Terminate()
            {
                System.Diagnostics.Debug.WriteLine("程序结束,你可以做一些清理工作");
            }
    
            //注册一个命令
            [CommandMethod ("InitCommand")]
            public void InitCommand()
            {
                Editor ed = Application.DocumentManager.MdiActiveDocument.Editor;
                ed.WriteMessage("测试初始化...");
            }
    
        }
    }

    同样的,需要设置用frame work 3.5编译以及引用两个程序集且要添加三个命名空间

    <<<<<<end>>>>>>

  • 相关阅读:
    二级域名配置
    环信框架-消息模块
    屏幕适配问题
    iOS-NSSession
    环信框架使用
    静态UITableView
    __weak存在的问题
    MVVM与MVC
    iOS通知与多线程
    block
  • 原文地址:https://www.cnblogs.com/Helchan/p/4395684.html
Copyright © 2011-2022 走看看