Message 1 of 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
is it possible to join multiple IEnumerable lists with different types so later I can loop through joined list?
public IEnumerable<WallType> FindWallTypes(Document doc)
{
FilteredElementCollector collector = new FilteredElementCollector(doc);
IEnumerable<WallType> BasicWalls = collector
.OfClass(typeof(WallType))
.Cast<WallType>()
.Where(w => w.Kind == WallKind.Basic);
return BasicWalls;
}
IEnumerable<WallType> all_wall_types = FindWallTypes(doc);
IEnumerable<FloorType> all_floor_types = FindFloorTypes(doc);
IEnumerable<RoofType> all_roof_types = FindRoofTypes(doc);
var list = Concatenate(all_wall_types, all_floor_types, all_roof_types);
foreach (var e in list)
{
string OldName = e.Name;
CompoundStructure FamilyCS = e.GetCompoundStructure() as CompoundStructure;
}
Solved! Go to Solution.