How to avoid collecting "Model in place" element

How to avoid collecting "Model in place" element

amir.aroesti
Advocate Advocate
377 Views
1 Reply
Message 1 of 2

How to avoid collecting "Model in place" element

amir.aroesti
Advocate
Advocate

hi

 

I have some model in place element that I want to avoid collecting them in my element filter collector.

 

            FilteredElementCollector collector = new FilteredElementCollector(doc);
            ElementCategoryFilter filter = new ElementCategoryFilter(BuiltInCategory.OST_Walls);
            IList<Wall> walls = collector.WherePasses(filter).WhereElementIsNotElementType().Cast<Wall>().ToList();
0 Likes
Accepted solutions (1)
378 Views
1 Reply
Reply (1)
Message 2 of 2

amir.aroesti
Advocate
Advocate
Accepted solution

FilteredElementCollector BasicWallCollector = new FilteredElementCollector(doc).OfClass(typeof(Wall));
IEnumerable<Wall> walls = BasicWallCollector.Cast<Wall>().Where(w => w.WallType.Kind == WallKind.Basic);

0 Likes