Moreover, I have the following code to retrieve the level of the design.
public List<Level> GetAllLevels() { List<Level> levelCollection = new List<Level>(); FilteredElementCollector collector = new FilteredElementCollector(_document); ICollection<Element> collection = collector.OfClass(typeof(Level)).ToElements(); foreach (var e in collection) { Level level = e as Level; if (null != level) { // keep track of number of levels levelCollection.Add(level); } } return levelCollection; }
But from this list, I need to query the rooms for each of the level separately.
Thanks