public static List <IfWall> GetWalls(IfStory ifStory) { List <IfWall> wallsList = new List <IfWall>(); var walls = ifStory.IfcStory.ContainsElements .FirstOrDefault() .RelatedElements.OfType <IIfcWall>(); foreach (var wall in walls) { var dir = ((IIfcAxis2Placement3D)((IIfcLocalPlacement)wall.ObjectPlacement).RelativePlacement).RefDirection; var recD = wall.Representation.Representations .SelectMany(a => a.Items) .OfType <IIfcExtrudedAreaSolid>().Select(a => a.SweptArea) .OfType <IIfcRectangleProfileDef>().FirstOrDefault() ?? wall.Representation.Representations .SelectMany(a => a.Items) .OfType <IIfcBooleanClippingResult>().Select(a => a.FirstOperand) .OfType <IIfcExtrudedAreaSolid>().Select(a => a.SweptArea) .OfType <IIfcRectangleProfileDef>().FirstOrDefault() ?? wall.Representation.Representations .SelectMany(a => a.Items) .OfType <IIfcBooleanClippingResult>().Select(a => a.FirstOperand) .OfType <IIfcBooleanClippingResult>().Select(a => a.FirstOperand) .OfType <IIfcExtrudedAreaSolid>().Select(a => a.SweptArea) .OfType <IIfcRectangleProfileDef>().FirstOrDefault() ?? wall.Representation.Representations .SelectMany(a => a.Items) .OfType <IIfcBooleanClippingResult>().Select(a => a.FirstOperand) .OfType <IIfcBooleanClippingResult>().Select(a => a.FirstOperand) .OfType <IIfcBooleanClippingResult>().Select(a => a.FirstOperand) .OfType <IIfcExtrudedAreaSolid>().Select(a => a.SweptArea) .OfType <IIfcRectangleProfileDef>().FirstOrDefault(); //get the wall x,y,z if (recD != null) { IfWall crntWall = new IfWall(ifStory.IfModel, wall) { Story = ifStory, IfModel = ifStory.IfModel }; if (dir != null && dir.X < 0) { crntWall.Direction = Direction.Negative; } else { crntWall.Direction = Direction.Positive; } wallsList.Add(crntWall); } } return(wallsList); }
private void Intialize() { if (IfStories != null) { return; } IfStories = IfStory.GetStories(this); }
public static List <IfFloor> GetFloors(IfStory ifStory) { List <IfFloor> FloorList = new List <IfFloor>(); var Floors = ifStory.IfcStory.ContainsElements .FirstOrDefault() .RelatedElements.OfType <IIfcSlab>(); foreach (var Floor in Floors) { var dir = ((IIfcAxis2Placement3D)((IIfcLocalPlacement)Floor.ObjectPlacement).RelativePlacement).RefDirection; var recD = Floor.Representation.Representations .SelectMany(a => a.Items) .OfType <IIfcExtrudedAreaSolid>().Select(a => a.SweptArea) .OfType <IIfcRectangleProfileDef>().FirstOrDefault() ?? Floor.Representation.Representations .SelectMany(a => a.Items) .OfType <IIfcBooleanClippingResult>().Select(a => a.FirstOperand) .OfType <IIfcExtrudedAreaSolid>().Select(a => a.SweptArea) .OfType <IIfcRectangleProfileDef>().FirstOrDefault() ?? Floor.Representation.Representations .SelectMany(a => a.Items) .OfType <IIfcBooleanClippingResult>().Select(a => a.FirstOperand) .OfType <IIfcBooleanClippingResult>().Select(a => a.FirstOperand) .OfType <IIfcExtrudedAreaSolid>().Select(a => a.SweptArea) .OfType <IIfcRectangleProfileDef>().FirstOrDefault() ?? Floor.Representation.Representations .SelectMany(a => a.Items) .OfType <IIfcBooleanClippingResult>().Select(a => a.FirstOperand) .OfType <IIfcBooleanClippingResult>().Select(a => a.FirstOperand) .OfType <IIfcBooleanClippingResult>().Select(a => a.FirstOperand) .OfType <IIfcExtrudedAreaSolid>().Select(a => a.SweptArea) .OfType <IIfcRectangleProfileDef>().FirstOrDefault(); //get the wall x,y,z if (recD != null) { IfFloor crntFloor = new IfFloor(ifStory.IfModel, Floor) { Story = ifStory, IfModel = ifStory.IfModel }; FloorList.Add(crntFloor); } } return(FloorList); }