Example #1
0
        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);
        }
Example #2
0
 public IfJoist(IfFloor floor) : base(floor.IfModel)
 {
     IfFloor     = floor;
     IfDirection = floor.ShortDirection;
 }