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();
}
}
}
}
转载于:https://www.cnblogs.com/swtool/p/3832330.html