zoukankan      html  css  js  c++  java
  • AutoCAD二次开发(.Net)之创建图层Layer

    //https://blog.csdn.net/qq_21489689?t=1
    [CommandMethod("CREATELY")] public void CreateLayer() { Document acDoc = Application.DocumentManager.MdiActiveDocument; Database acCurDb = acDoc.Database;//获取当前数据库 using (Transaction acTrans = acCurDb.TransactionManager.StartTransaction()) { //以读的方式打开图层表 LayerTable acLyrTbl = acTrans.GetObject(acCurDb.LayerTableId,OpenMode.ForRead) as LayerTable; string sLayerName = "Layer Name";//设定一个图层名称 if (acLyrTbl.Has(sLayerName) == false) { using (LayerTableRecord acLyrTblRec = new LayerTableRecord()) { acLyrTblRec.Color = Color.FromColorIndex(ColorMethod.ByAci, 3);// 指定图层颜色 acLyrTblRec.Name = sLayerName;// 指定图层名称 acLyrTbl.UpgradeOpen();//修改图层打开方式为写 acLyrTbl.Add(acLyrTblRec);//将新图层追加到图层表 acTrans.AddNewlyCreatedDBObject(acLyrTblRec, true); } } acTrans.Commit(); } }
  • 相关阅读:
    [并发编程] 进程、线程
    100. 相同的树
    Python 问题集
    this关键字在函数中的应用
    去除列表右边框
    JS——作用域
    javascript——值传递!!
    null和undefined的区别?
    浏览器内核——四大主流
    http常用状态码
  • 原文地址:https://www.cnblogs.com/belx/p/9256234.html
Copyright © 2011-2022 走看看