private IEnumerable <IIfcZone> GetAllZones(IEnumerable <IIfcSpace> allSpaces, CoBieLiteHelper helper) { var allZones = new HashSet <IIfcZone>(); foreach (var space in allSpaces) { foreach (var zone in helper.GetZones(space)) { allZones.Add(zone); } } return(allZones); }
//private IfcSpace _ifcSpace; public SpaceType(IIfcSpace ifcSpace, CoBieLiteHelper helper) : this() { // _ifcSpace = ifcSpace; externalEntityName = helper.ExternalEntityName(ifcSpace); externalID = helper.ExternalEntityIdentity(ifcSpace); externalSystemName = helper.ExternalSystemName(ifcSpace); SpaceName = ifcSpace.Name; SpaceCategory = helper.GetClassification(ifcSpace); SpaceDescription = ifcSpace.Description; SpaceSignageName = helper.GetCoBieAttribute <StringValueType>("SpaceSignageName", ifcSpace).StringValue; SpaceUsableHeightValue = helper.GetCoBieAttribute <DecimalValueType>("SpaceUsableHeightValue", ifcSpace); SpaceGrossAreaValue = helper.GetCoBieAttribute <DecimalValueType>("SpaceGrossAreaValue", ifcSpace); SpaceNetAreaValue = helper.GetCoBieAttribute <DecimalValueType>("SpaceNetAreaValue", ifcSpace); //Zone Assignment var zones = helper.GetZones(ifcSpace); if (zones != null) { var ifcZones = zones.ToArray(); SpaceZoneAssignments = new ZoneAssignmentCollectionType { ZoneAssignment = new List <ZoneKeyType>(ifcZones.Length) }; for (int i = 0; i < ifcZones.Length; i++) { var zoneAssignment = new ZoneKeyType(); zoneAssignment.ZoneCategory = helper.GetClassification(ifcZones[i]); zoneAssignment.ZoneName = ifcZones[i].Name; zoneAssignment.externalIDReference = helper.ExternalEntityIdentity(ifcZones[i]); SpaceZoneAssignments.Add(zoneAssignment); } } //Attributes var ifcAttributes = helper.GetAttributes(ifcSpace); if (ifcAttributes != null && ifcAttributes.Any()) { SpaceAttributes = new AttributeCollectionType { Attribute = ifcAttributes } } ; //TODO: //Space Issues //Space Documents }