• AutoCAD.Net 实现创建wipeout遮罩实体


     [CommandMethod("mywipeout")]
            public static void mywipeout()
            {
                
                // 获取当前文档和数据库
                Document acDoc = Application.DocumentManager.MdiActiveDocument;
                Database acCurDb = acDoc.Database;
                // 启动事务
                using (Transaction acTrans = acCurDb.TransactionManager.StartTransaction())
                {
                    // 以读模式打开Block表
                    BlockTable acBlkTbl;
                    acBlkTbl = acTrans.GetObject(acCurDb.BlockTableId,
                    OpenMode.ForRead) as BlockTable;
                    // 以写模式打开Block表记录Model空间
                    BlockTableRecord acBlkTblRec;
                    acBlkTblRec = acTrans.GetObject(acBlkTbl[BlockTableRecord.ModelSpace],
                    OpenMode.ForWrite) as BlockTableRecord;
                    Point2dCollection pt2dArray = new Point2dCollection();
                    pt2dArray.Add(new Point2d(0, 0));
                    pt2dArray.Add(new Point2d(100, 0));
                    pt2dArray.Add(new Point2d(100, 100));
                    pt2dArray.Add(new Point2d(0, 100));
                    pt2dArray.Add(new Point2d(0, 0));//必须闭合
                    Wipeout wipeoutEnt = new Wipeout();
                    wipeoutEnt.SetFrom(pt2dArray, new Vector3d(0, 0, 1));
                    acBlkTblRec.AppendEntity(wipeoutEnt);
                    acTrans.AddNewlyCreatedDBObject(wipeoutEnt, true);
                    acTrans.Commit();
                }
            }
    

      

  • 相关阅读:
    26个精选的JavaScript面试问题
    用js实现随机选取10–100之间的10个数字,存入一个数组,并排序
    小程序布局中class='container'的bug
    PHP接收数据数据包的几个方式
    LINUX命令
    VMware的下载安装
    php中Sessions
    php中Cookies
    php文件上传
    php文件处理
  • 原文地址:https://www.cnblogs.com/edata/p/10105336.html
Copyright © 2020-2023  润新知