EaBIM
标题:
[数据库操作] 图层清理
[打印本页]
作者:
萧闫子
时间:
2014-1-8 14:06
标题:
[数据库操作] 图层清理
public string[] PurgeLayers()
{
List<string> Lays = new List<string>();
using (Transaction Trans = DB.TransactionManager.StartTransaction)
{
LayerTable LayTab = Trans.GetObject(DB.LayerTableId, OpenMode.ForWrite);
DB.Clayer = LayTab("0");
ObjectIdCollection IDs = new ObjectIdCollection();
foreach (ObjectId ID in LayTab)
{
IDs.Add(ID);
}
DB.Purge(IDs);
LayerTableRecord LayTabRec = null;
foreach (ObjectId ID in IDs)
{
LayTabRec = Trans.GetObject(ID, OpenMode.ForWrite);
Lays.Add(LayTabRec.Name.ToUpper);
LayTabRec.Erase(true);
}
Trans.Commit();
}
return Lays.ToArray();
}
复制代码
欢迎光临 EaBIM (https://eabim.net/)
Powered by Discuz! X3.2