Message 1 of 5
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I am trying to delete a specific layer of dwg files inserted to rvt file.
Following code works only for the first dwg but cannot work for other files.
doc.Delete(c.Id)
It means the foreach loop in the following code doesn't work.
FilteredElementCollector eCollector = new FilteredElementCollector(doc);
eCollector.OfClass(typeof(ImportInstance)); foreach ( ImportInstance e in eCollector) { foreach ( Category c in e.Category.SubCategories) { if (c.Name == "0") // layer name { doc.Delete(c.Id); } } }
Any feedback would be appreciated.
Thanks,
Eri
Solved! Go to Solution.