码迷,mamicode.com
首页 > Web开发 > 详细

cad.net删除wipeout

时间:2014-07-09 15:05:08      阅读:284      评论:0      收藏:0      [点我收藏+]

标签:art   cti   for   io   .net   app   

namespace BCCDELWIPOUT
{
    public class DraftingTools
    {

        [CommandMethod("BCC:WOUT")]

        public static void BCCDELETEWIPOUT()
        {
            Document doc = Application.DocumentManager.MdiActiveDocument;
            Database db = doc.Database;
            Transaction tr = db.TransactionManager.StartTransaction();

            using (tr)
            {
                BlockTable bt = tr.GetObject(db.BlockTableId, OpenMode.ForWrite) as BlockTable;
                foreach (ObjectId objId in bt)
                {
                    BlockTableRecord btr = objId.GetObject(OpenMode.ForWrite) as BlockTableRecord;

                    foreach (ObjectId btrObjId in btr)
                    {
                        Entity ent = btrObjId.GetObject(OpenMode.ForWrite) as Entity;
                        if (ent is Wipeout)
                        {
                            ent.Erase();
                            
                        }
                    }
                } tr.Commit();
            }
        }
    }
}

cad.net删除wipeout,布布扣,bubuko.com

cad.net删除wipeout

标签:art   cti   for   io   .net   app   

原文地址:http://www.cnblogs.com/swtool/p/3832330.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!