Message 1 of 3
Collect all room element from the model
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
i read some post here and understand the issue about collecting room.
FilteredElementCollector collector = new FilteredElementCollector(doc);
ElementCategoryFilter filter = new ElementCategoryFilter(BuiltInCategory.OST_Walls);
IList<Wall> walls = collector.WherePasses(filter).WhereElementIsNotElementType().Cast<Wall>().ToList();
IList<Element> rooms = collector.OfClass(typeof(SpatialElement)).ToElements();
StringBuilder sb = new StringBuilder();
foreach (Wall w in walls)
{
sb.AppendLine(string.Format("wall id: {0}", w.Id.ToString()));
}
TaskDialog.Show("Test", sb.ToString() + "number of rooms " + rooms.Count().ToString());
i tried this but unfortunately dont get any element.
any Idea?