可以通过调用如下方法进行删除
static public void EraseLayer(Document doc, Database db,List<string> listStrLayerName)
{
using (Transaction tr=db.TransactionManager.StartTransaction())
{
//open layertable
LayerTable lt = tr.GetObject(db.LayerTableId, OpenMode.ForRead) as LayerTable;
foreach (string strLayerName in listStrLayerName)
{
if (lt.Has(strLayerName)==true)
{
ObjectId layerId=lt[strLayerName];
if (db.Clayer==layerId) //current layer can't be delete
{
continue;
}
LayerTableRecord layerTableRecord = tr.GetObject(layerId, OpenMode.ForWrite) as LayerTableRecord;
layerTableRecord.IsLocke