private static void ExtractObjects() { List<ElementId> materials = null; Material material = null; ElementFilter WallFilter = new ElementCategoryFilter(BuiltInCategory.OST_Walls); ElementFilter NonStruWallFilter = new StructuralWallUsageFilter(StructuralWallUsage.NonBearing); ElementFilter WallClassFilter = new ElementClassFilter(typeof(Wall)); FilteredElementCollector GypWalls = new FilteredElementCollector(_doc); GypWalls.WherePasses(WallFilter).WherePasses(NonStruWallFilter); int[] count1 = new int[2]; //0:Gyp, 1:wallpaper, 2:ceramic foreach (Wall wall in GypWalls) { materials = wall.GetMaterialIds(false).ToList(); foreach (ElementId eleId in materials) { material = _doc.GetElement(eleId) as Material; if (material.MaterialCategory == _addiInfo.materialTypes[(byte)PGMaterialType.Gypsum]) ++count1[0]; else if (material.MaterialCategory == _addiInfo.materialTypes[(byte)PGMaterialType.WallPaper]) ++count1[1]; else if (material.MaterialCategory == _addiInfo.materialTypes[(byte)PGMaterialType.Ceramic]) ++count1[2]; } //assert: count1[i] is non-negative if (count1[0] == 0) continue; if (count1[1] == 0 && count1[2] == 0) _GypWalls.Add(new RichWall(wall,FinishType.None)); else if(count1[2] == 0) //assert: count1[1] != 0 { if (count1[1] == 1) _GypWalls.Add(new RichWall(wall,FinishType.OneWallpaper)); else if (count1[1] == 2) _GypWalls.Add(new RichWall(wall,FinishType.TwoWallpaper)); } else if(count1[1] == 0) //assert: count1[2] != 0 { if (count1[2] == 1) _GypWalls.Add(new RichWall(wall,FinishType.OneCeramic)); else if (count1[2] == 2) _GypWalls.Add(new RichWall(wall,FinishType.TwoCeramic)); } else _abandonWriter.WriteAbandonment(wall, AbandonmentTable.TooManyFinishes); } if (_addiInfo.requiredComp[(byte)PGComponents.WallFinish]) { int count2 = 0; FilteredElementCollector GeneticWalls = new FilteredElementCollector(_doc); GeneticWalls.WherePasses(WallFilter).WherePasses(WallClassFilter); foreach (Wall wall in GeneticWalls) { materials = wall.GetMaterialIds(false).ToList(); foreach (ElementId eleId in materials) { material = _doc.GetElement(eleId) as Material; if (material.MaterialCategory == _addiInfo.materialTypes[(byte)PGMaterialType.Wood] || material.MaterialCategory == _addiInfo.materialTypes[(byte)PGMaterialType.Marble]) ++count2; } if (count2 == 1) _GeneticWalls.Add(new RichWall(wall,FinishType.OneWood)); else if (count2 == 2) _GeneticWalls.Add(new RichWall(wall,FinishType.TwoWood)); else if (2 <= count2) _abandonWriter.WriteAbandonment(wall, AbandonmentTable.TooManyFinishes); } } }
private static void ExtractObjects() { FilteredElementCollector Walls = new FilteredElementCollector(_doc); ElementFilter WallFilter = new ElementCategoryFilter(BuiltInCategory.OST_Walls); ElementFilter NonStruWallFilter = new StructuralWallUsageFilter(StructuralWallUsage.NonBearing); Walls.WherePasses(WallFilter).WherePasses(NonStruWallFilter); foreach (Wall wall in Walls) { if (wall.Name.Contains("Storefront") || wall.Name.Contains("店面")) { _Storefronts.Add(wall); } } }
private static void ExtractObjects() { FilteredElementCollector Walls = new FilteredElementCollector(_doc); ElementFilter WallFilter = new ElementCategoryFilter(BuiltInCategory.OST_Walls); ElementFilter NonStruWallFilter = new StructuralWallUsageFilter(StructuralWallUsage.NonBearing); Walls.WherePasses(WallFilter).WherePasses(NonStruWallFilter); foreach (Wall wall in Walls) { if (wall.WallType.Kind == WallKind.Curtain) { _CurtainWalls.Add(wall); } } }
private static void ExtractObjects() { List <ElementId> materials = null; Material material = null; ElementFilter WallFilter = new ElementCategoryFilter(BuiltInCategory.OST_Walls); ElementFilter NonStruWallFilter = new StructuralWallUsageFilter(StructuralWallUsage.NonBearing); ElementFilter WallClassFilter = new ElementClassFilter(typeof(Wall)); FilteredElementCollector GypWalls = new FilteredElementCollector(_doc); GypWalls.WherePasses(WallFilter).WherePasses(NonStruWallFilter); int[] count1 = new int[2]; //0:Gyp, 1:wallpaper, 2:ceramic foreach (Wall wall in GypWalls) { materials = wall.GetMaterialIds(false).ToList(); foreach (ElementId eleId in materials) { material = _doc.GetElement(eleId) as Material; if (material.MaterialCategory == _addiInfo.materialTypes[(byte)PGMaterialType.Gypsum]) { ++count1[0]; } else if (material.MaterialCategory == _addiInfo.materialTypes[(byte)PGMaterialType.WallPaper]) { ++count1[1]; } else if (material.MaterialCategory == _addiInfo.materialTypes[(byte)PGMaterialType.Ceramic]) { ++count1[2]; } } //assert: count1[i] is non-negative if (count1[0] == 0) { continue; } if (count1[1] == 0 && count1[2] == 0) { _GypWalls.Add(new RichWall(wall, FinishType.None)); } else if (count1[2] == 0) //assert: count1[1] != 0 { if (count1[1] == 1) { _GypWalls.Add(new RichWall(wall, FinishType.OneWallpaper)); } else if (count1[1] == 2) { _GypWalls.Add(new RichWall(wall, FinishType.TwoWallpaper)); } } else if (count1[1] == 0) //assert: count1[2] != 0 { if (count1[2] == 1) { _GypWalls.Add(new RichWall(wall, FinishType.OneCeramic)); } else if (count1[2] == 2) { _GypWalls.Add(new RichWall(wall, FinishType.TwoCeramic)); } } else { _abandonWriter.WriteAbandonment(wall, AbandonmentTable.TooManyFinishes); } } if (_addiInfo.requiredComp[(byte)PGComponents.WallFinish]) { int count2 = 0; FilteredElementCollector GeneticWalls = new FilteredElementCollector(_doc); GeneticWalls.WherePasses(WallFilter).WherePasses(WallClassFilter); foreach (Wall wall in GeneticWalls) { materials = wall.GetMaterialIds(false).ToList(); foreach (ElementId eleId in materials) { material = _doc.GetElement(eleId) as Material; if (material.MaterialCategory == _addiInfo.materialTypes[(byte)PGMaterialType.Wood] || material.MaterialCategory == _addiInfo.materialTypes[(byte)PGMaterialType.Marble]) { ++count2; } } if (count2 == 1) { _GeneticWalls.Add(new RichWall(wall, FinishType.OneWood)); } else if (count2 == 2) { _GeneticWalls.Add(new RichWall(wall, FinishType.TwoWood)); } else if (2 <= count2) { _abandonWriter.WriteAbandonment(wall, AbandonmentTable.TooManyFinishes); } } } }