/// <summary>
        /// Initializes custom property sets from schedules.
        /// </summary>
        /// <param name="propertySets">List to store property sets.</param>
        /// <param name="fileVersion">The IFC file version.</param>
        private static void InitCustomPropertySets(IList<IList<PropertySetDescription>> propertySets)
        {
            Document document = ExporterCacheManager.Document;
            IList<PropertySetDescription> customPropertySets = new List<PropertySetDescription>();

            // Collect all ViewSchedules from the document to use as custom property sets.
            FilteredElementCollector viewScheduleElementCollector = new FilteredElementCollector(document);

            ElementFilter viewScheduleElementFilter = new ElementClassFilter(typeof(ViewSchedule));
            viewScheduleElementCollector.WherePasses(viewScheduleElementFilter);
            List<ViewSchedule> filteredSchedules = viewScheduleElementCollector.Cast<ViewSchedule>().ToList();

            int unnamedScheduleIndex = 1;

            string includePattern = "PSET|IFC|COMMON";

            if (ExporterCacheManager.ExportOptionsCache.PropertySetOptions.ExportSpecificSchedules)
            {
                var resultQuery =
                    from viewSchedule in viewScheduleElementCollector
                    where viewSchedule.Name != null &&
                    System.Text.RegularExpressions.Regex.IsMatch(viewSchedule.Name, includePattern, System.Text.RegularExpressions.RegexOptions.IgnoreCase)
                    select viewSchedule;
                filteredSchedules = resultQuery.Cast<ViewSchedule>().ToList();
            }

            foreach (ViewSchedule schedule in filteredSchedules)
            {
                //property set Manufacturer Information
                PropertySetDescription customPSet = new PropertySetDescription();

                string scheduleName = schedule.Name;
                if (string.IsNullOrWhiteSpace(scheduleName))
                {
                    scheduleName = "Unnamed Schedule " + unnamedScheduleIndex;
                    unnamedScheduleIndex++;
                }
                customPSet.Name = scheduleName;

                ScheduleDefinition definition = schedule.Definition;
                if (definition == null)
                    continue;

                // The schedule will be responsible for determining which elements to actually export.
                customPSet.ViewScheduleId = schedule.Id;
                customPSet.EntityTypes.Add(IFCEntityType.IfcProduct);

                int fieldCount = definition.GetFieldCount();
                if (fieldCount == 0)
                    continue;

                HashSet<ElementId> containedElementIds = new HashSet<ElementId>();
                FilteredElementCollector elementsInViewScheduleCollector = new FilteredElementCollector(document, schedule.Id);
                foreach (Element containedElement in elementsInViewScheduleCollector)
                {
                    containedElementIds.Add(containedElement.Id);
                }
                ExporterCacheManager.ViewScheduleElementCache.Add(new KeyValuePair<ElementId, HashSet<ElementId>>(schedule.Id, containedElementIds));

                IDictionary<ElementId, Element> cachedElementTypes = new Dictionary<ElementId, Element>();

                for (int ii = 0; ii < fieldCount; ii++)
                {
                    ScheduleField field = definition.GetField(ii);

                    ScheduleFieldType fieldType = field.FieldType;
                    if (fieldType != ScheduleFieldType.Instance && fieldType != ScheduleFieldType.ElementType)
                        continue;

                    ElementId parameterId = field.ParameterId;
                    if (parameterId == ElementId.InvalidElementId)
                        continue;

                    // We use asBuiltInParameterId to get the parameter by id below.  We don't want to use it later, however, so
                    // we store builtInParameterId only if it is a proper member of the enumeration.
                    BuiltInParameter asBuiltInParameterId = (BuiltInParameter)parameterId.IntegerValue;
                    BuiltInParameter builtInParameterId =
                        Enum.IsDefined(typeof(BuiltInParameter), asBuiltInParameterId) ? asBuiltInParameterId : BuiltInParameter.INVALID;

                    Parameter containedElementParameter = null;

                    // We could cache the actual elements when we store the element ids.  However, this would almost certainly take more
                    // time than getting one of the first few elements in the collector.
                    foreach (Element containedElement in elementsInViewScheduleCollector)
                    {
                        if (fieldType == ScheduleFieldType.Instance)
                            containedElementParameter = containedElement.get_Parameter(asBuiltInParameterId);

                        // shared parameters can return ScheduleFieldType.Instance, even if they are type parameters, so take a look.
                        if (containedElementParameter == null)
                        {
                            ElementId containedElementTypeId = containedElement.GetTypeId();
                            Element containedElementType = null;
                            if (containedElementTypeId != ElementId.InvalidElementId)
                            {
                                if (!cachedElementTypes.TryGetValue(containedElementTypeId, out containedElementType))
                                {
                                    containedElementType = document.GetElement(containedElementTypeId);
                                    cachedElementTypes[containedElementTypeId] = containedElementType;
                                }
                            }
                            if (containedElementType != null)
                                containedElementParameter = containedElementType.get_Parameter(asBuiltInParameterId);
                        }

                        if (containedElementParameter != null)
                            break;
                    }
                    if (containedElementParameter == null)
                        continue;

                    PropertySetEntry ifcPSE = PropertySetEntry.CreateParameterEntry(containedElementParameter);
                    ifcPSE.RevitBuiltInParameter = builtInParameterId;
                    ifcPSE.PropertyName = field.ColumnHeading;
                    customPSet.AddEntry(ifcPSE);
                }

                customPropertySets.Add(customPSet);
            }

            propertySets.Add(customPropertySets);
        }
        /// <summary>
        /// Initializes the Pset_FlowTerminalAirTerminal property set.
        /// </summary>
        /// <param name="commonPropertySets">List to store property sets.</param>
        private static void InitPropertySetFlowTerminalAirTerminal(IList<PropertySetDescription> commonPropertySets)
        {
            //property beam common
            PropertySetDescription propertyFlowTerminalAirTerminal = new PropertySetDescription();
            propertyFlowTerminalAirTerminal.Name = "Pset_FlowTerminalAirTerminal";
            propertyFlowTerminalAirTerminal.SubElementIndex = (int)IFCCommonPSets.PSetFlowTerminalAirTerminal;

            propertyFlowTerminalAirTerminal.EntityTypes.Add(IFCEntityType.IfcFlowTerminal);

            propertyFlowTerminalAirTerminal.AddEntry(PropertySetEntry.CreateEnumeratedValue("AirflowType", PropertyType.Label,
                typeof(PSetFlowTerminalAirTerminal_AirTerminalAirflowType)));
            propertyFlowTerminalAirTerminal.AddEntry(PropertySetEntry.CreateEnumeratedValue("Location", PropertyType.Label,
                typeof(PSetFlowTerminalAirTerminal_AirTerminalLocation)));

            commonPropertySets.Add(propertyFlowTerminalAirTerminal);
        }
        /// <summary>
        /// Initializes common beam property sets.
        /// </summary>
        /// <param name="commonPropertySets">List to store property sets.</param>
        private static void InitPropertySetBeamCommon(IList<PropertySetDescription> commonPropertySets)
        {
            //property beam common
            PropertySetDescription propertySetBeamCommon = new PropertySetDescription();
            propertySetBeamCommon.Name = "Pset_BeamCommon";
            propertySetBeamCommon.SubElementIndex = (int)IFCCommonPSets.PSetBeamCommon;

            propertySetBeamCommon.EntityTypes.Add(IFCEntityType.IfcBeam);

            PropertySetEntry ifcPSE = PropertySetEntryUtil.CreateReferenceEntry();
            propertySetBeamCommon.AddEntry(ifcPSE);

            ifcPSE = PropertySetEntryUtil.CreateLoadBearingEntry(BeamLoadBearingCalculator.Instance);
            propertySetBeamCommon.AddEntry(ifcPSE);

            ifcPSE = PropertySetEntryUtil.CreateIsExternalEntry();
            propertySetBeamCommon.AddEntry(ifcPSE);

            ifcPSE = PropertySetEntryUtil.CreateFireRatingEntry();
            propertySetBeamCommon.AddEntry(ifcPSE);

            ifcPSE = PropertySetEntry.CreatePositiveLength("Span");
            ifcPSE.RevitBuiltInParameter = BuiltInParameter.INSTANCE_LENGTH_PARAM;
            ifcPSE.PropertyCalculator = BeamSpanCalculator.Instance;
            propertySetBeamCommon.AddEntry(ifcPSE);

            ifcPSE = PropertySetEntry.CreatePlaneAngle("Slope");
            ifcPSE.PropertyCalculator = SlopeCalculator.Instance;
            propertySetBeamCommon.AddEntry(ifcPSE);

            if (ExporterCacheManager.ExportOptionsCache.ExportAs4)
            {
                propertySetBeamCommon.AddEntry(PropertySetEntryUtil.CreateStatusEntry());
                propertySetBeamCommon.AddEntry(PropertySetEntry.CreatePlaneAngle("Roll"));
                propertySetBeamCommon.AddEntry(PropertySetEntryUtil.CreateThermalTransmittanceEntry());
            }

            commonPropertySets.Add(propertySetBeamCommon);
        }
        /// <summary>
        /// Initializes common LightFixtureType property sets.
        /// </summary>
        /// <param name="commonPropertySets">List to store property sets.</param>
        private static void InitPropertySetLightFixtureTypeCommon(IList<PropertySetDescription> commonPropertySets)
        {
            //property beam common
            PropertySetDescription propertySetLightFixtureTypeCommon = new PropertySetDescription();
            propertySetLightFixtureTypeCommon.Name = "Pset_LightFixtureTypeCommon";
            propertySetLightFixtureTypeCommon.SubElementIndex = (int)IFCCommonPSets.PSetLightFixtureTypeCommon;

            propertySetLightFixtureTypeCommon.EntityTypes.Add(IFCEntityType.IfcLightFixtureType);

            PropertySetEntry ifcPSE = PropertySetEntry.CreateInteger("NumberOfSources");
            propertySetLightFixtureTypeCommon.AddEntry(ifcPSE);

            ifcPSE = PropertySetEntry.CreatePower("TotalWattage");
            ifcPSE.RevitBuiltInParameter = BuiltInParameter.LIGHTING_FIXTURE_WATTAGE;
            propertySetLightFixtureTypeCommon.AddEntry(ifcPSE);

            ifcPSE = PropertySetEntry.CreateEnumeratedValue("LightFixtureMountingType", PropertyType.Label,
                typeof(PSetLightFixtureTypeCommon_LightFixtureMountingType));
            propertySetLightFixtureTypeCommon.AddEntry(ifcPSE);

            ifcPSE = PropertySetEntry.CreateEnumeratedValue("LightFixturePlacingType", PropertyType.Label,
                typeof(PSetLightFixtureTypeCommon_LightFixturePlacingType));
            propertySetLightFixtureTypeCommon.AddEntry(ifcPSE);

            propertySetLightFixtureTypeCommon.AddEntry(PropertySetEntry.CreateReal("MaintenanceFactor"));

            // The value below is incorrect.  Although it is specified in IFC2x3, it is a duplicate of Pset_ManufacturerTypeInformation,
            // where it is correctly labelled as IfcIdentifier.
            //propertySetLightFixtureTypeCommon.AddEntry(PropertySetEntry.CreateClassificationReference("ArticleNumber"));

            if (ExporterCacheManager.ExportOptionsCache.ExportAs4)
            {
                propertySetLightFixtureTypeCommon.AddEntry(PropertySetEntryUtil.CreateReferenceEntry());
                propertySetLightFixtureTypeCommon.AddEntry(PropertySetEntryUtil.CreateStatusEntry());
                propertySetLightFixtureTypeCommon.AddEntry(PropertySetEntry.CreatePower("MaximumPlenumSensibleLoad"));
                propertySetLightFixtureTypeCommon.AddEntry(PropertySetEntry.CreatePower("MaximumSpaceSensibleLoad"));
                propertySetLightFixtureTypeCommon.AddEntry(PropertySetEntry.CreatePositiveRatio("SensibleLoadToRadiant"));
            }
            else
                propertySetLightFixtureTypeCommon.AddEntry(PropertySetEntry.CreateText("ManufacturersSpecificInformation"));

            commonPropertySets.Add(propertySetLightFixtureTypeCommon);
        }
        /// <summary>
        /// Initializes the Pset_ElectricalCircuit property set.
        /// </summary>
        /// <param name="commonPropertySets">List to store property sets.</param>
        private static void InitPropertySetElectricalCircuit(IList<PropertySetDescription> commonPropertySets)
        {
            //property beam common
            PropertySetDescription propertySetElectricalCircuit = new PropertySetDescription();
            propertySetElectricalCircuit.Name = "Pset_ElectricalCircuit";

            propertySetElectricalCircuit.EntityTypes.Add(IFCEntityType.IfcElectricalCircuit);

            propertySetElectricalCircuit.AddEntry(PropertySetEntry.CreatePositiveRatio("Diversity"));
            propertySetElectricalCircuit.AddEntry(PropertySetEntry.CreateInteger("NumberOfPhases"));
            //propertySetElectricalCircuit.AddEntry(PropertySetEntry.CreateElectricVoltage("MaximumAllowedVoltageDrop"));
            //propertySetElectricalCircuit.AddEntry(PropertySetEntry.CreateElectricResistance("NetImpedance"));

            commonPropertySets.Add(propertySetElectricalCircuit);
        }
        /// <summary>
        /// Initializes common covering property sets.
        /// </summary>
        /// <param name="commonPropertySets">List to store property sets.</param>
        private static void InitPropertySetCoveringCommon(IList<PropertySetDescription> commonPropertySets)
        {
            //property set covering common
            PropertySetDescription propertySetCoveringCommon = new PropertySetDescription();
            propertySetCoveringCommon.Name = "Pset_CoveringCommon";
            propertySetCoveringCommon.SubElementIndex = (int)IFCCommonPSets.PSetCoveringCommon;

            propertySetCoveringCommon.EntityTypes.Add(IFCEntityType.IfcCovering);

            PropertySetEntry ifcPSE = PropertySetEntryUtil.CreateReferenceEntry();
            propertySetCoveringCommon.AddEntry(ifcPSE);

            ifcPSE = PropertySetEntryUtil.CreateFireRatingEntry();
            propertySetCoveringCommon.AddEntry(ifcPSE);

            propertySetCoveringCommon.AddEntry(PropertySetEntryUtil.CreateAcousticRatingEntry());
            propertySetCoveringCommon.AddEntry(PropertySetEntry.CreateLabel("FlammabilityRating"));
            propertySetCoveringCommon.AddEntry(PropertySetEntryUtil.CreateSurfaceSpreadOfFlameEntry());
            propertySetCoveringCommon.AddEntry(PropertySetEntryUtil.CreateCombustibleEntry());


            if (ExporterCacheManager.ExportOptionsCache.ExportAs4)
                propertySetCoveringCommon.AddEntry(PropertySetEntry.CreateLabel("FragilityRating"));
            else
                propertySetCoveringCommon.AddEntry(PropertySetEntry.CreateLabel("Fragility"));

            ifcPSE = PropertySetEntry.CreateText("Finish");
            ifcPSE.PropertyCalculator = CoveringFinishCalculator.Instance;
            propertySetCoveringCommon.AddEntry(ifcPSE);


            if (ExporterCacheManager.ExportOptionsCache.ExportAs4)
            {
                propertySetCoveringCommon.AddEntry(PropertySetEntryUtil.CreateStatusEntry());
                propertySetCoveringCommon.AddEntry(PropertySetEntryUtil.CreateIsExternalEntry());
                propertySetCoveringCommon.AddEntry(PropertySetEntryUtil.CreateThermalTransmittanceEntry());
            }
            else
            {
                ifcPSE = PropertySetEntry.CreatePositiveLength("TotalThickness");
                ifcPSE.RevitBuiltInParameter = BuiltInParameter.CEILING_THICKNESS;
                propertySetCoveringCommon.AddEntry(ifcPSE);
            }

            commonPropertySets.Add(propertySetCoveringCommon);
        }
        /// <summary>
        /// Initializes a common door/window property set (Pset_DoorWindowShadingType)
        /// </summary>
        /// <param name="commonPropertySets">List to store property sets.</param>
        private static void InitPropertySetDoorWindowShadingType(IList<PropertySetDescription> commonPropertySets)
        {
            //property set Pset_DoorWindowShadingType
            PropertySetDescription propertySetDoorWindowShadingType = new PropertySetDescription();
            propertySetDoorWindowShadingType.Name = "Pset_DoorWindowShadingType";
            propertySetDoorWindowShadingType.SubElementIndex = (int)IFCCommonPSets.PsetDoorWindowShadingType;

            propertySetDoorWindowShadingType.EntityTypes.Add(IFCEntityType.IfcDoor);
            propertySetDoorWindowShadingType.EntityTypes.Add(IFCEntityType.IfcWindow);

            if (ExporterCacheManager.ExportOptionsCache.ExportAs4)
            {
                // Note: This conflicts with the property of the same name in Pset_DoorWindowGlazingType.
                propertySetDoorWindowShadingType.AddEntry(PropertySetEntry.CreateNormalisedRatio("ShadingCoefficient"));
            }

            propertySetDoorWindowShadingType.AddEntry(PropertySetEntry.CreatePositiveRatio("ExternalShadingCoefficient"));
            propertySetDoorWindowShadingType.AddEntry(PropertySetEntry.CreatePositiveRatio("InternalShadingCoefficient"));
            propertySetDoorWindowShadingType.AddEntry(PropertySetEntry.CreatePositiveRatio("InsetShadingCoefficient"));

            commonPropertySets.Add(propertySetDoorWindowShadingType);
        }
        /// <summary>
        /// Initializes Pset_SanitaryTerminalTypeWashHandBasin
        /// </summary>
        /// <param name="commonPropertySets">List to store property sets.</param>
        private static void InitPropertySetSanitaryTerminalTypeWashHandBasin(IList<PropertySetDescription> commonPropertySets)
        {
            PropertySetDescription propertySetWashHandBasin = new PropertySetDescription();
            propertySetWashHandBasin.Name = "Pset_SanitaryTerminalTypeWashHandBasin";
            propertySetWashHandBasin.EntityTypes.Add(IFCEntityType.IfcSanitaryTerminalType);
            propertySetWashHandBasin.PredefinedType = "WASHHANDBASIN";

            propertySetWashHandBasin.AddEntry(PropertySetEntry.CreateEnumeratedValue("WashHandBasinType", PropertyType.Label,
                typeof(PsetSanitaryTerminalTypeWashHandBasin_WashHandBasinType)));
            // PsetSanitaryTerminalTypeToiletPan_SanitaryMounting is purposely reused, as it is identical.
            propertySetWashHandBasin.AddEntry(PropertySetEntry.CreateEnumeratedValue("WashHandBasinMounting", PropertyType.Label,
                typeof(PsetSanitaryTerminalTypeToiletPan_SanitaryMounting)));
            //propertySetWashHandBasin.AddEntry(PropertySetEntry.CreateMaterial("Material"));
            propertySetWashHandBasin.AddEntry(PropertySetEntry.CreatePositiveLength("NominalLength"));
            propertySetWashHandBasin.AddEntry(PropertySetEntry.CreatePositiveLength("NominalWidth"));
            propertySetWashHandBasin.AddEntry(PropertySetEntry.CreatePositiveLength("NominalDepth"));
            propertySetWashHandBasin.AddEntry(PropertySetEntry.CreateText("Color"));
            propertySetWashHandBasin.AddEntry(PropertySetEntry.CreatePositiveLength("DrainSize"));

            commonPropertySets.Add(propertySetWashHandBasin);
        }
        /// <summary>
        /// Initializes Pset_SwitchingDeviceTypeCommon
        /// </summary>
        /// <param name="commonPropertySets">List to store property sets.</param>
        private static void InitPropertySetSwitchingDeviceTypeCommon(IList<PropertySetDescription> commonPropertySets)
        {
            PropertySetDescription propertySetSwitchingDeviceTypeCommon = new PropertySetDescription();
            propertySetSwitchingDeviceTypeCommon.Name = "Pset_SwitchingDeviceTypeCommon";
            propertySetSwitchingDeviceTypeCommon.EntityTypes.Add(IFCEntityType.IfcSwitchingDeviceType);

            propertySetSwitchingDeviceTypeCommon.AddEntry(PropertySetEntry.CreateInteger("NumberOfGangs"));
            propertySetSwitchingDeviceTypeCommon.AddEntry(PropertySetEntry.CreateEnumeratedValue("SwitchFunction",
                PropertyType.Label, typeof(PsetSwitchingDeviceTypeCommon_SwitchFunction)));
            propertySetSwitchingDeviceTypeCommon.AddEntry(PropertySetEntry.CreateBoolean("HasLock"));

            if (ExporterCacheManager.ExportOptionsCache.ExportAs4)
            {
                propertySetSwitchingDeviceTypeCommon.AddEntry(PropertySetEntryUtil.CreateReferenceEntry());
                propertySetSwitchingDeviceTypeCommon.AddEntry(PropertySetEntryUtil.CreateStatusEntry());
                propertySetSwitchingDeviceTypeCommon.AddEntry(PropertySetEntry.CreateBoolean("IsIlluminated"));
                propertySetSwitchingDeviceTypeCommon.AddEntry(PropertySetEntry.CreateLabel("Legend"));
                // cannot support table value: skip SetPoint property
            }

            commonPropertySets.Add(propertySetSwitchingDeviceTypeCommon);
        }
        /// <summary>
        /// Initializes Pset_SanitaryTerminalTypeShower
        /// </summary>
        /// <param name="commonPropertySets">List to store property sets.</param>
        private static void InitPropertySetSanitaryTerminalTypeShower(IList<PropertySetDescription> commonPropertySets)
        {
            PropertySetDescription propertySetShower = new PropertySetDescription();
            propertySetShower.Name = "Pset_SanitaryTerminalTypeShower";
            propertySetShower.EntityTypes.Add(IFCEntityType.IfcSanitaryTerminalType);
            propertySetShower.PredefinedType = "SHOWER";

            propertySetShower.AddEntry(PropertySetEntry.CreateEnumeratedValue("ShowerType", PropertyType.Label,
                typeof(PsetSanitaryTerminalTypeShower_ShowerType)));
            propertySetShower.AddEntry(PropertySetEntry.CreateBoolean("HasTray"));
            propertySetShower.AddEntry(PropertySetEntry.CreatePositiveLength("NominalLength"));
            propertySetShower.AddEntry(PropertySetEntry.CreatePositiveLength("NominalWidth"));
            propertySetShower.AddEntry(PropertySetEntry.CreatePositiveLength("NominalDepth"));

            //propertySetShower.AddEntry(PropertySetEntry.CreateMaterial("Material"));
            propertySetShower.AddEntry(PropertySetEntry.CreatePositiveLength("MaterialThickness"));
            propertySetShower.AddEntry(PropertySetEntry.CreateText("Color"));
            propertySetShower.AddEntry(PropertySetEntry.CreateText("ShowerHeadDescription"));
            propertySetShower.AddEntry(PropertySetEntry.CreatePositiveLength("DrainSize"));

            commonPropertySets.Add(propertySetShower);
        }
        /// <summary>
        /// Initializes Pset_SanitaryTerminalTypeToiletPan
        /// </summary>
        /// <param name="commonPropertySets">List to store property sets.</param>
        private static void InitPropertySetSanitaryTerminalTypeToiletPan(IList<PropertySetDescription> commonPropertySets)
        {
            PropertySetDescription propertySetToiletPan = new PropertySetDescription();
            propertySetToiletPan.Name = "Pset_SanitaryTerminalTypeToiletPan";
            propertySetToiletPan.EntityTypes.Add(IFCEntityType.IfcSanitaryTerminalType);
            propertySetToiletPan.PredefinedType = "TOILETPAN";

            propertySetToiletPan.AddEntry(PropertySetEntry.CreateEnumeratedValue("ToiletType", PropertyType.Label,
                typeof(PsetSanitaryTerminalTypeToiletPan_ToiletType)));
            propertySetToiletPan.AddEntry(PropertySetEntry.CreateEnumeratedValue("ToiletPanType", PropertyType.Label,
                typeof(PsetSanitaryTerminalTypeToiletPan_ToiletPanType)));
            propertySetToiletPan.AddEntry(PropertySetEntry.CreateEnumeratedValue("PanMounting", PropertyType.Label,
                typeof(PsetSanitaryTerminalTypeToiletPan_SanitaryMounting)));
            //propertySetToiletPan.AddEntry(PropertySetEntry.CreateMaterial("PanMaterial"));
            if (ExporterCacheManager.ExportOptionsCache.ExportAs4)
                propertySetToiletPan.AddEntry(PropertySetEntry.CreateLabel("Color"));
            else
                propertySetToiletPan.AddEntry(PropertySetEntry.CreateText("PanColor"));
            propertySetToiletPan.AddEntry(PropertySetEntry.CreatePositiveLength("SpilloverLevel"));
            propertySetToiletPan.AddEntry(PropertySetEntry.CreatePositiveLength("NominalLength"));
            propertySetToiletPan.AddEntry(PropertySetEntry.CreatePositiveLength("NominalWidth"));
            propertySetToiletPan.AddEntry(PropertySetEntry.CreatePositiveLength("NominalDepth"));

            commonPropertySets.Add(propertySetToiletPan);
        }
        /// <summary>
        /// Initializes Pset_SanitaryTerminalTypeBath
        /// </summary>
        /// <param name="commonPropertySets">List to store property sets.</param>
        private static void InitPropertySetSanitaryTerminalTypeBath(IList<PropertySetDescription> commonPropertySets)
        {
            PropertySetDescription propertySetBath = new PropertySetDescription();
            propertySetBath.Name = "Pset_SanitaryTerminalTypeBath";
            propertySetBath.EntityTypes.Add(IFCEntityType.IfcSanitaryTerminalType);
            propertySetBath.PredefinedType = "BATH";

            propertySetBath.AddEntry(PropertySetEntry.CreateEnumeratedValue("BathType", PropertyType.Label,
                typeof(PsetSanitaryTerminalTypeBath_BathType)));
            propertySetBath.AddEntry(PropertySetEntry.CreatePositiveLength("NominalLength"));
            propertySetBath.AddEntry(PropertySetEntry.CreatePositiveLength("NominalWidth"));
            propertySetBath.AddEntry(PropertySetEntry.CreatePositiveLength("NominalDepth"));

            //propertySetBath.AddEntry(PropertySetEntry.CreateMaterial("Material"));
            propertySetBath.AddEntry(PropertySetEntry.CreatePositiveLength("MaterialThickness"));
            propertySetBath.AddEntry(PropertySetEntry.CreateText("Color"));
            propertySetBath.AddEntry(PropertySetEntry.CreatePositiveLength("DrainSize"));
            propertySetBath.AddEntry(PropertySetEntry.CreateBoolean("HasGrabHandles"));

            commonPropertySets.Add(propertySetBath);
        }
        /// <summary>
        /// Initializes Pset_ProvisionForVoid.
        /// </summary>
        /// <param name="commonPropertySets">List to store property sets.</param>
        private static void InitPropertySetProvisionForVoid(IList<PropertySetDescription> commonPropertySets)
        {
            PropertySetDescription propertySetProvisionForVoid = new PropertySetDescription();
            if (ExporterCacheManager.ExportOptionsCache.ExportAs4)
                propertySetProvisionForVoid.Name = "Pset_BuildingElementProxyProvisionForVoid";
            else
                propertySetProvisionForVoid.Name = "Pset_ProvisionForVoid";

            propertySetProvisionForVoid.EntityTypes.Add(IFCEntityType.IfcBuildingElementProxy);
            propertySetProvisionForVoid.ObjectType = "ProvisionForVoid";

            // The Shape value must be determined first, as other calculators will use the value stored.
            PropertySetEntry ifcPSE = PropertySetEntry.CreateLabel("Shape");
            ifcPSE.PropertyCalculator = ProvisionForVoidShapeCalculator.Instance;
            propertySetProvisionForVoid.AddEntry(ifcPSE);

            ifcPSE = PropertySetEntry.CreatePositiveLength("Width");
            ifcPSE.PropertyCalculator = ProvisionForVoidWidthCalculator.Instance;
            propertySetProvisionForVoid.AddEntry(ifcPSE);

            ifcPSE = PropertySetEntry.CreatePositiveLength("Height");
            ifcPSE.PropertyCalculator = ProvisionForVoidHeightCalculator.Instance;
            propertySetProvisionForVoid.AddEntry(ifcPSE);

            ifcPSE = PropertySetEntry.CreatePositiveLength("Diameter");
            ifcPSE.PropertyCalculator = ProvisionForVoidDiameterCalculator.Instance;
            propertySetProvisionForVoid.AddEntry(ifcPSE);

            ifcPSE = PropertySetEntry.CreatePositiveLength("Depth");
            ifcPSE.PropertyCalculator = ProvisionForVoidDepthCalculator.Instance;
            propertySetProvisionForVoid.AddEntry(ifcPSE);

            ifcPSE = PropertySetEntry.CreateLabel("System");
            propertySetProvisionForVoid.AddEntry(ifcPSE);

            commonPropertySets.Add(propertySetProvisionForVoid);
        }
        /// <summary>
        /// Initializes element shading property sets.
        /// </summary>
        /// <param name="commonPropertySets">List to store property sets.</param>
        private static void InitPropertySetElementShading(IList<PropertySetDescription> commonPropertySets)
        {
            PropertySetDescription propertySetElementShading = new PropertySetDescription();
            propertySetElementShading.Name = "Pset_ElementShading";
            propertySetElementShading.EntityTypes.Add(IFCEntityType.IfcBuildingElementProxy);
            propertySetElementShading.ObjectType = "Solar Shade";

            propertySetElementShading.AddEntry(PropertySetEntry.CreateEnumeratedValue("ShadingDeviceType", PropertyType.Label,
                typeof(PSetElementShading_ShadingDeviceType)));
            propertySetElementShading.AddEntry(PropertySetEntry.CreatePlaneAngle("Azimuth"));
            propertySetElementShading.AddEntry(PropertySetEntry.CreatePlaneAngle("Inclination"));
            propertySetElementShading.AddEntry(PropertySetEntry.CreatePlaneAngle("TiltRange"));
            propertySetElementShading.AddEntry(PropertySetEntry.CreatePositiveRatio("AverageSolarTransmittance"));
            propertySetElementShading.AddEntry(PropertySetEntry.CreatePositiveRatio("AverageVisibleTransmittance"));
            propertySetElementShading.AddEntry(PropertySetEntry.CreatePositiveRatio("Reflectance"));
            propertySetElementShading.AddEntry(PropertySetEntry.CreatePositiveLength("Roughness"));
            propertySetElementShading.AddEntry(PropertySetEntry.CreateLabel("Color"));

            commonPropertySets.Add(propertySetElementShading);
        }
        /// <summary>
        /// Initializes manufacturer type information property sets for all IfcElements.
        /// </summary>
        /// <param name="commonPropertySets">List to store property sets.</param>
        private static void InitPropertySetManufacturerTypeInformation(IList<PropertySetDescription> commonPropertySets)
        {
            //property set Manufacturer Information
            PropertySetDescription propertySetManufacturer = new PropertySetDescription();
            propertySetManufacturer.Name = "Pset_ManufacturerTypeInformation";

            // sub type of IfcElement
            propertySetManufacturer.EntityTypes.Add(IFCEntityType.IfcElement);

            PropertySetEntry ifcPSE = PropertySetEntry.CreateIdentifier("ArticleNumber");
            propertySetManufacturer.AddEntry(ifcPSE);

            ifcPSE = PropertySetEntry.CreateLabel("ModelReference");
            propertySetManufacturer.AddEntry(ifcPSE);

            ifcPSE = PropertySetEntry.CreateLabel("ModelLabel");
            propertySetManufacturer.AddEntry(ifcPSE);

            ifcPSE = PropertySetEntry.CreateLabel("Manufacturer");
            ifcPSE.RevitBuiltInParameter = BuiltInParameter.ALL_MODEL_MANUFACTURER;
            propertySetManufacturer.AddEntry(ifcPSE);

            ifcPSE = PropertySetEntry.CreateLabel("ProductionYear");
            propertySetManufacturer.AddEntry(ifcPSE);

            if (ExporterCacheManager.ExportOptionsCache.ExportAs4)
            {
                propertySetManufacturer.AddEntry(PropertySetEntry.CreateIdentifier("GlobalTradeItemNumber"));
                propertySetManufacturer.AddEntry(PropertySetEntry.CreateEnumeratedValue("AssemblyPlace",
                    PropertyType.Label, typeof(Toolkit.IFC4.PsetManufacturerTypeInformation_AssemblyPlace)));
            }

            commonPropertySets.Add(propertySetManufacturer);
        }
        /// <summary>
        /// Initializes Pset_SwitchingDeviceTypeToggleSwitch
        /// </summary>
        /// <param name="commonPropertySets">List to store property sets.</param>
        private static void InitPropertySetSwitchingDeviceTypeToggleSwitch(IList<PropertySetDescription> commonPropertySets)
        {
            PropertySetDescription propertySetSwitchingDeviceTypeToggleSwitch = new PropertySetDescription();
            propertySetSwitchingDeviceTypeToggleSwitch.Name = "Pset_SwitchingDeviceTypeToggleSwitch";
            propertySetSwitchingDeviceTypeToggleSwitch.EntityTypes.Add(IFCEntityType.IfcSwitchingDeviceType);
            // TODO: Restrict to TOGGLESWITCH.

            propertySetSwitchingDeviceTypeToggleSwitch.AddEntry(PropertySetEntry.CreateEnumeratedValue("ToggleSwitchType",
                PropertyType.Label, typeof(PsetSwitchingDeviceTypeToggleSwitch_ToggleSwitchType)));
            propertySetSwitchingDeviceTypeToggleSwitch.AddEntry(PropertySetEntry.CreateEnumeratedValue("SwitchUsage",
                PropertyType.Label, typeof(PsetSwitchingDeviceTypeToggleSwitch_SwitchUsage)));
            propertySetSwitchingDeviceTypeToggleSwitch.AddEntry(PropertySetEntry.CreateEnumeratedValue("SwitchActivation",
                PropertyType.Label, typeof(PsetSwitchingDeviceTypeToggleSwitch_SwitchActivation)));

            if (!ExporterCacheManager.ExportOptionsCache.ExportAs4)
            {
                // properties have been removed in IFc4
                propertySetSwitchingDeviceTypeToggleSwitch.AddEntry(PropertySetEntry.CreateBoolean("IsIlluminated"));
                propertySetSwitchingDeviceTypeToggleSwitch.AddEntry(PropertySetEntry.CreateLabel("Legend"));
            }

            commonPropertySets.Add(propertySetSwitchingDeviceTypeToggleSwitch);
        }
        /// <summary>
        /// Initializes common curtain wall property sets.
        /// </summary>
        /// <param name="commonPropertySets">List to store property sets.</param>
        private static void InitPropertySetCurtainWallCommon(IList<PropertySetDescription> commonPropertySets)
        {
            //property set curtain wall common
            PropertySetDescription propertySetCurtainWallCommon = new PropertySetDescription();
            propertySetCurtainWallCommon.Name = "Pset_CurtainWallCommon";
            propertySetCurtainWallCommon.SubElementIndex = (int)IFCCommonPSets.PSetCurtainWallCommon;

            propertySetCurtainWallCommon.EntityTypes.Add(IFCEntityType.IfcCurtainWall);

            PropertySetEntry ifcPSE = PropertySetEntryUtil.CreateReferenceEntry();
            propertySetCurtainWallCommon.AddEntry(ifcPSE);

            ifcPSE = PropertySetEntryUtil.CreateIsExternalEntry();
            propertySetCurtainWallCommon.AddEntry(ifcPSE);

            ifcPSE = PropertySetEntryUtil.CreateFireRatingEntry();
            propertySetCurtainWallCommon.AddEntry(ifcPSE);

            ifcPSE = PropertySetEntryUtil.CreateThermalTransmittanceEntry();
            propertySetCurtainWallCommon.AddEntry(ifcPSE);

            propertySetCurtainWallCommon.AddEntry(PropertySetEntryUtil.CreateAcousticRatingEntry());
            propertySetCurtainWallCommon.AddEntry(PropertySetEntryUtil.CreateSurfaceSpreadOfFlameEntry());
            propertySetCurtainWallCommon.AddEntry(PropertySetEntryUtil.CreateCombustibleEntry());

            if (ExporterCacheManager.ExportOptionsCache.ExportAs4)
                propertySetCurtainWallCommon.AddEntry(PropertySetEntryUtil.CreateStatusEntry());

            commonPropertySets.Add(propertySetCurtainWallCommon);
        }
        /// <summary>
        /// Initializes COBIE space thermal simulation property sets.
        /// </summary>
        /// <param name="cobiePropertySets">List to store property sets.</param>
        private static void InitCOBIEPSetSpaceThermalSimulationProperties(IList<PropertySetDescription> cobiePropertySets)
        {
            PropertySetDescription propertySetSpaceThermalSimulationProperties = new PropertySetDescription();
            propertySetSpaceThermalSimulationProperties.Name = "ePset_SpaceThermalSimulationProperties";
            propertySetSpaceThermalSimulationProperties.EntityTypes.Add(IFCEntityType.IfcSpace);

            PropertySetEntry ifcPSE = PropertySetEntry.CreateLabel("Space Thermal Simulation Type");
            ifcPSE.PropertyName = "SpaceThermalSimulationType";
            propertySetSpaceThermalSimulationProperties.AddEntry(ifcPSE);

            ifcPSE = PropertySetEntry.CreateLabel("Space Conditioning Requirement");
            ifcPSE.PropertyName = "SpaceConditioningRequirement";
            propertySetSpaceThermalSimulationProperties.AddEntry(ifcPSE);

            ifcPSE = PropertySetEntry.CreateReal("Space Occupant Density");
            ifcPSE.PropertyName = "SpaceOccupantDensity";
            propertySetSpaceThermalSimulationProperties.AddEntry(ifcPSE);

            ifcPSE = PropertySetEntry.CreateReal("Space Occupant Heat Rate");
            ifcPSE.PropertyName = "SpaceOccupantHeatRate";
            propertySetSpaceThermalSimulationProperties.AddEntry(ifcPSE);

            ifcPSE = PropertySetEntry.CreateReal("Space Occupant Load");
            ifcPSE.PropertyName = "SpaceOccupantLoad";
            propertySetSpaceThermalSimulationProperties.AddEntry(ifcPSE);

            ifcPSE = PropertySetEntry.CreateReal("Space Equipment Load");
            ifcPSE.PropertyName = "SpaceEquipmentLoad";
            propertySetSpaceThermalSimulationProperties.AddEntry(ifcPSE);

            ifcPSE = PropertySetEntry.CreateReal("Space Lighting Load");
            ifcPSE.PropertyName = "SpaceLightingLoad";
            propertySetSpaceThermalSimulationProperties.AddEntry(ifcPSE);

            cobiePropertySets.Add(propertySetSpaceThermalSimulationProperties);
        }
        /// <summary>
        /// Initializes a common door/window property set (Pset_DoorWindowGlazingType).
        /// </summary>
        /// <param name="commonPropertySets">List to store property sets.</param>
        private static void InitPropertySetDoorWindowGlazingType(IList<PropertySetDescription> commonPropertySets)
        {
            //property set Pset_DoorWindowGlazingType
            PropertySetDescription propertySetDoorWindowGlazingType = new PropertySetDescription();
            propertySetDoorWindowGlazingType.Name = "Pset_DoorWindowGlazingType";
            propertySetDoorWindowGlazingType.SubElementIndex = (int)IFCCommonPSets.PSetDoorWindowGlazingType;

            propertySetDoorWindowGlazingType.EntityTypes.Add(IFCEntityType.IfcDoor);
            propertySetDoorWindowGlazingType.EntityTypes.Add(IFCEntityType.IfcWindow);

            propertySetDoorWindowGlazingType.AddEntry(PropertySetEntry.CreateCount("GlassLayers"));
            propertySetDoorWindowGlazingType.AddEntry(PropertySetEntry.CreatePositiveLength("GlassThickness1"));
            propertySetDoorWindowGlazingType.AddEntry(PropertySetEntry.CreatePositiveLength("GlassThickness2"));
            propertySetDoorWindowGlazingType.AddEntry(PropertySetEntry.CreatePositiveLength("GlassThickness3"));
            propertySetDoorWindowGlazingType.AddEntry(PropertySetEntry.CreateLabel("FillGas"));
            propertySetDoorWindowGlazingType.AddEntry(PropertySetEntry.CreateLabel("GlassColor"));
            propertySetDoorWindowGlazingType.AddEntry(PropertySetEntry.CreateBoolean("IsTempered"));
            propertySetDoorWindowGlazingType.AddEntry(PropertySetEntry.CreateBoolean("IsLaminated"));
            propertySetDoorWindowGlazingType.AddEntry(PropertySetEntry.CreateBoolean("IsCoated"));
            propertySetDoorWindowGlazingType.AddEntry(PropertySetEntry.CreateBoolean("IsWired"));

            if (ExporterCacheManager.ExportOptionsCache.ExportAs4)
            {
                propertySetDoorWindowGlazingType.AddEntry(PropertySetEntry.CreateNormalisedRatio("VisibleLightReflectance"));
                propertySetDoorWindowGlazingType.AddEntry(PropertySetEntry.CreateNormalisedRatio("VisibleLightTransmittance"));
                propertySetDoorWindowGlazingType.AddEntry(PropertySetEntry.CreateNormalisedRatio("SolarAbsorption"));
                propertySetDoorWindowGlazingType.AddEntry(PropertySetEntry.CreateNormalisedRatio("SolarReflectance"));
                propertySetDoorWindowGlazingType.AddEntry(PropertySetEntry.CreateNormalisedRatio("SolarTransmittance"));
                propertySetDoorWindowGlazingType.AddEntry(PropertySetEntry.CreateNormalisedRatio("SolarHeatGainTransmittance"));
                propertySetDoorWindowGlazingType.AddEntry(PropertySetEntry.CreateNormalisedRatio("ShadingCoefficient"));
            }
            else
            {
                propertySetDoorWindowGlazingType.AddEntry(PropertySetEntry.CreatePositiveRatio("Translucency"));
                propertySetDoorWindowGlazingType.AddEntry(PropertySetEntry.CreatePositiveRatio("Reflectivity"));
                propertySetDoorWindowGlazingType.AddEntry(PropertySetEntry.CreatePositiveRatio("BeamRadiationTransmittance"));
                propertySetDoorWindowGlazingType.AddEntry(PropertySetEntry.CreatePositiveRatio("SolarHeatGainTransmittance"));
            }

            propertySetDoorWindowGlazingType.AddEntry(PropertySetEntry.CreateThermalTransmittance("ThermalTransmittanceSummer"));
            propertySetDoorWindowGlazingType.AddEntry(PropertySetEntry.CreateThermalTransmittance("ThermalTransmittanceWinter"));

            commonPropertySets.Add(propertySetDoorWindowGlazingType);
        }
        /// <summary>
        /// Initializes space thermal design property sets.
        /// </summary>
        /// <param name="commonPropertySets">List to store property sets.</param>
        private static void InitPropertySetSpaceThermalDesign(IList<PropertySetDescription> commonPropertySets)
        {
            PropertySetDescription propertySetSpaceThermalDesign = new PropertySetDescription();
            propertySetSpaceThermalDesign.Name = "Pset_SpaceThermalDesign";
            propertySetSpaceThermalDesign.EntityTypes.Add(IFCEntityType.IfcSpace);

            PropertySetEntry ifcPSE = PropertySetEntry.CreateVolumetricFlowRate("CoolingDesignAirflow");
            propertySetSpaceThermalDesign.AddEntry(ifcPSE);

            ifcPSE = PropertySetEntry.CreateVolumetricFlowRate("HeatingDesignAirflow");
            propertySetSpaceThermalDesign.AddEntry(ifcPSE);

            ifcPSE = PropertySetEntry.CreatePower("TotalSensibleHeatGain");
            propertySetSpaceThermalDesign.AddEntry(ifcPSE);

            ifcPSE = PropertySetEntry.CreatePower("TotalHeatGain");
            propertySetSpaceThermalDesign.AddEntry(ifcPSE);

            ifcPSE = PropertySetEntry.CreatePower("TotalHeatLoss");
            propertySetSpaceThermalDesign.AddEntry(ifcPSE);

            ifcPSE = PropertySetEntry.CreateThermodynamicTemperature("Inside Dry Bulb Temperature - Cooling");
            ifcPSE.PropertyName = "CoolingDryBulb";
            propertySetSpaceThermalDesign.AddEntry(ifcPSE);

            ifcPSE = PropertySetEntry.CreatePositiveRatio("Inside Relative Humidity - Cooling");
            ifcPSE.PropertyName = "CoolingRelativeHumidity";
            propertySetSpaceThermalDesign.AddEntry(ifcPSE);

            ifcPSE = PropertySetEntry.CreateThermodynamicTemperature("Inside Dry Bulb Temperature - Heating");
            ifcPSE.PropertyName = "HeatingDryBulb";
            propertySetSpaceThermalDesign.AddEntry(ifcPSE);

            ifcPSE = PropertySetEntry.CreatePositiveRatio("Inside Relative Humidity - Heating");
            ifcPSE.PropertyName = "HeatingRelativeHumidity";
            propertySetSpaceThermalDesign.AddEntry(ifcPSE);

            ifcPSE = PropertySetEntry.CreateVolumetricFlowRate("VentilationAirFlowrate");
            propertySetSpaceThermalDesign.AddEntry(ifcPSE);

            ifcPSE = PropertySetEntry.CreateVolumetricFlowRate("ExhaustAirFlowrate");
            propertySetSpaceThermalDesign.AddEntry(ifcPSE);

            ifcPSE = PropertySetEntry.CreateBoolean("Inside Return Air Plenum");
            ifcPSE.PropertyName = "CeilingRAPlenum";
            propertySetSpaceThermalDesign.AddEntry(ifcPSE);

            // BoundaryAreaHeatLoss not yet supported.

            commonPropertySets.Add(propertySetSpaceThermalDesign);
        }
        /// <summary>
        /// Initializes common window property sets.
        /// </summary>
        /// <param name="commonPropertySets">List to store property sets.</param>
        private static void InitPropertySetWindowCommon(IList<PropertySetDescription> commonPropertySets)
        {
            //property set wall common
            PropertySetDescription propertySetWindowCommon = new PropertySetDescription();
            propertySetWindowCommon.Name = "Pset_WindowCommon";
            propertySetWindowCommon.SubElementIndex = (int)IFCCommonPSets.PSetWindowCommon;

            propertySetWindowCommon.EntityTypes.Add(IFCEntityType.IfcWindow);

            PropertySetEntry ifcPSE = PropertySetEntryUtil.CreateReferenceEntry();
            propertySetWindowCommon.AddEntry(ifcPSE);

            ifcPSE = PropertySetEntryUtil.CreateIsExternalEntry();
            propertySetWindowCommon.AddEntry(ifcPSE);

            ifcPSE = PropertySetEntryUtil.CreateFireRatingEntry();
            propertySetWindowCommon.AddEntry(ifcPSE);

            ifcPSE = PropertySetEntryUtil.CreateThermalTransmittanceEntry();
            propertySetWindowCommon.AddEntry(ifcPSE);

            propertySetWindowCommon.AddEntry(PropertySetEntryUtil.CreateAcousticRatingEntry());
            propertySetWindowCommon.AddEntry(PropertySetEntry.CreateLabel("SecurityRating"));

            propertySetWindowCommon.AddEntry(PropertySetEntry.CreateBoolean("SmokeStop"));
            propertySetWindowCommon.AddEntry(PropertySetEntry.CreateReal("GlazingAreaFraction"));
            propertySetWindowCommon.AddEntry(PropertySetEntry.CreateVolumetricFlowRate("Infiltration"));

            if (ExporterCacheManager.ExportOptionsCache.ExportAs4)
            {
                propertySetWindowCommon.AddEntry(PropertySetEntryUtil.CreateStatusEntry());
                propertySetWindowCommon.AddEntry(PropertySetEntry.CreateBoolean("HasSillExternal"));
                propertySetWindowCommon.AddEntry(PropertySetEntry.CreateBoolean("HasSillInternal"));
                propertySetWindowCommon.AddEntry(PropertySetEntry.CreateBoolean("HasDrive"));
                propertySetWindowCommon.AddEntry(PropertySetEntry.CreateBoolean("FireExit"));
            }

            commonPropertySets.Add(propertySetWindowCommon);
        }
        /// <summary>
        /// Initializes COBIE space ventilation criteria property sets.
        /// </summary>
        /// <param name="cobiePropertySets">List to store property sets.</param>
        private static void InitCOBIEPSetSpaceVentilationCriteria(IList<PropertySetDescription> cobiePropertySets)
        {
            PropertySetDescription propertySetSpaceVentilationCriteria = new PropertySetDescription();
            propertySetSpaceVentilationCriteria.Name = "ePset_SpaceVentilationCriteria";
            propertySetSpaceVentilationCriteria.EntityTypes.Add(IFCEntityType.IfcSpace);

            PropertySetEntry ifcPSE = PropertySetEntry.CreateLabel("Ventilation Type");
            ifcPSE.PropertyName = "VentilationType";
            propertySetSpaceVentilationCriteria.AddEntry(ifcPSE);

            ifcPSE = PropertySetEntry.CreateReal("Outside Air Per Person");
            ifcPSE.PropertyName = "OutsideAirPerPerson";
            propertySetSpaceVentilationCriteria.AddEntry(ifcPSE);

            cobiePropertySets.Add(propertySetSpaceVentilationCriteria);
        }
        /// <summary>
        /// Initializes the Pset_DistributionFlowElementCommon property set.
        /// </summary>
        /// <param name="commonPropertySets">List to store property sets.</param>
        private static void InitPropertySetDistributionFlowElementCommon(IList<PropertySetDescription> commonPropertySets)
        {
            //property beam common
            PropertySetDescription propertyDistributionFlowElementCommon = new PropertySetDescription();
            propertyDistributionFlowElementCommon.Name = "Pset_DistributionFlowElementCommon";
            propertyDistributionFlowElementCommon.SubElementIndex = (int)IFCCommonPSets.PSetDistributionFlowElementCommon;

            propertyDistributionFlowElementCommon.EntityTypes.Add(IFCEntityType.IfcDistributionFlowElement);

            PropertySetEntry ifcPSE = PropertySetEntryUtil.CreateReferenceEntry();
            propertyDistributionFlowElementCommon.AddEntry(ifcPSE);

            commonPropertySets.Add(propertyDistributionFlowElementCommon);
        }
        /// <summary>
        /// Initializes COBIE building energy target property sets.
        /// </summary>
        /// <param name="cobiePropertySets">List to store property sets.</param>
        private static void InitCOBIEPSetBuildingEnergyTarget(IList<PropertySetDescription> cobiePropertySets)
        {
            PropertySetDescription propertySetBuildingEnergyTarget = new PropertySetDescription();
            propertySetBuildingEnergyTarget.Name = "ePset_BuildingEnergyTarget";
            propertySetBuildingEnergyTarget.EntityTypes.Add(IFCEntityType.IfcBuilding);

            PropertySetEntry ifcPSE = PropertySetEntry.CreateReal("Building Energy Target Value");
            ifcPSE.PropertyName = "BuildingEnergyTargetValue";
            propertySetBuildingEnergyTarget.AddEntry(ifcPSE);

            ifcPSE = PropertySetEntry.CreateLabel("Building Energy Target Units");
            ifcPSE.PropertyName = "BuildingEnergyTargetUnits";
            propertySetBuildingEnergyTarget.AddEntry(ifcPSE);

            cobiePropertySets.Add(propertySetBuildingEnergyTarget);
        }
        /// <summary>
        /// Initializes the Pset_ElectricalDeviceCommon property set.
        /// </summary>
        /// <param name="commonPropertySets">List to store property sets.</param>
        private static void InitPropertySetElectricalDeviceCommon(IList<PropertySetDescription> commonPropertySets)
        {
            //property ElectricalDeviceCommon common
            PropertySetDescription propertySetElectricalDeviceCommon = new PropertySetDescription();
            propertySetElectricalDeviceCommon.Name = "Pset_ElectricalDeviceCommon";

            propertySetElectricalDeviceCommon.EntityTypes.Add(IFCEntityType.IfcDistributionElement);

            propertySetElectricalDeviceCommon.AddEntry(PropertySetEntry.CreateFrequency("NominalFrequencyRange"));
            propertySetElectricalDeviceCommon.AddEntry(PropertySetEntry.CreateInteger("NumberOfPoles"));
            propertySetElectricalDeviceCommon.AddEntry(PropertySetEntry.CreateBoolean("HasProtectiveEarth"));
            propertySetElectricalDeviceCommon.AddEntry(PropertySetEntry.CreateLabel("IP_Code"));
            propertySetElectricalDeviceCommon.AddEntry(PropertySetEntry.CreateEnumeratedValue("InsulationStandardClass",
                PropertyType.Label, typeof(PSetElectricalDeviceCommon_InsulationStandardClass)));

            if (ExporterCacheManager.ExportOptionsCache.ExportAs4)
            {
                propertySetElectricalDeviceCommon.AddEntry(PropertySetEntry.CreateElectricalCurrent("RatedCurrent"));
                propertySetElectricalDeviceCommon.AddEntry(PropertySetEntry.CreateElectricalVoltage("RatedVoltage"));
                propertySetElectricalDeviceCommon.AddEntry(PropertySetEntry.CreateRatio("PowerFactor"));
                propertySetElectricalDeviceCommon.AddEntry(PropertySetEntry.CreateEnumeratedValue("ConductorFunction", PropertyType.Label,
                    typeof(Toolkit.IFC4.PsetElectricalDeviceCommon_ConductorFunction)));
            }
            else
            {
                propertySetElectricalDeviceCommon.AddEntry(PropertySetEntry.CreateElectricalCurrent("NominalCurrent"));
                propertySetElectricalDeviceCommon.AddEntry(PropertySetEntry.CreateElectricalCurrent("UsageCurrent"));
                propertySetElectricalDeviceCommon.AddEntry(PropertySetEntry.CreateElectricalVoltage("NominalVoltage"));
                propertySetElectricalDeviceCommon.AddEntry(PropertySetEntry.CreatePower("ElectricalDeviceNominalPower"));
                propertySetElectricalDeviceCommon.AddEntry(PropertySetEntry.CreatePositivePlaneAngle("PhaseAngle"));
                propertySetElectricalDeviceCommon.AddEntry(PropertySetEntry.CreateIdentifier("PhaseReference"));
            }

            commonPropertySets.Add(propertySetElectricalDeviceCommon);
        }
        /// <summary>
        /// Initializes COBIE glazing properties energy analysis property sets.
        /// </summary>
        /// <param name="cobiePropertySets">List to store property sets.</param>
        private static void InitCOBIEPSetGlazingPropertiesEnergyAnalysis(IList<PropertySetDescription> cobiePropertySets)
        {
            PropertySetDescription propertySetGlazingPropertiesEnergyAnalysis = new PropertySetDescription();
            propertySetGlazingPropertiesEnergyAnalysis.Name = "ePset_GlazingPropertiesEnergyAnalysis";
            propertySetGlazingPropertiesEnergyAnalysis.EntityTypes.Add(IFCEntityType.IfcCurtainWall);

            PropertySetEntry ifcPSE = PropertySetEntry.CreateLabel("Windows 6 Glazing System Name");
            ifcPSE.PropertyName = "Windows6GlazingSystemName";
            propertySetGlazingPropertiesEnergyAnalysis.AddEntry(ifcPSE);

            cobiePropertySets.Add(propertySetGlazingPropertiesEnergyAnalysis);
        }
        /// <summary>
        /// Initializes the Pset_AirTerminalTypeCommon property set.
        /// </summary>
        /// <param name="commonPropertySets">List to store property sets.</param>
        private static void InitPropertySetAirTerminalTypeCommon(IList<PropertySetDescription> commonPropertySets)
        {
            //property air terminal type common
            PropertySetDescription propertyAirTerminalTypeCommon = new PropertySetDescription();
            propertyAirTerminalTypeCommon.Name = "Pset_AirTerminalTypeCommon";
            propertyAirTerminalTypeCommon.SubElementIndex = (int)IFCCommonPSets.PSetAirTerminalTypeCommon;

            propertyAirTerminalTypeCommon.EntityTypes.Add(IFCEntityType.IfcAirTerminalType);

            propertyAirTerminalTypeCommon.AddEntry(PropertySetEntry.CreateEnumeratedValue("Shape", PropertyType.Label,
                typeof(PSetAirTerminalTypeCommon_AirTerminalShape)));
            propertyAirTerminalTypeCommon.AddEntry(PropertySetEntry.CreateEnumeratedValue("FlowPattern", PropertyType.Label,
                typeof(PSetAirTerminalTypeCommon_AirTerminalFlowPattern)));
            propertyAirTerminalTypeCommon.AddEntry(PropertySetEntry.CreateVolumetricFlowRate("AirFlowrateRange"));
            propertyAirTerminalTypeCommon.AddEntry(PropertySetEntry.CreateThermodynamicTemperature("TemperatureRange"));
            propertyAirTerminalTypeCommon.AddEntry(PropertySetEntry.CreateEnumeratedValue("DischargeDirection", PropertyType.Label,
                typeof(PSetAirTerminalTypeCommon_AirTerminalDischargeDirection)));
            propertyAirTerminalTypeCommon.AddEntry(PropertySetEntry.CreateLength("ThrowLength"));
            propertyAirTerminalTypeCommon.AddEntry(PropertySetEntry.CreateReal("AirDiffusionPerformanceIndex"));
            //propertyAirTerminalTypeCommon.AddEntry(PropertySetEntry.CreateMaterial("Material"));
            propertyAirTerminalTypeCommon.AddEntry(PropertySetEntry.CreateEnumeratedValue("FinishType", PropertyType.Label,
                typeof(PSetAirTerminalTypeCommon_AirTerminalFinishType)));
            propertyAirTerminalTypeCommon.AddEntry(PropertySetEntry.CreateLabel("FinishColor"));
            propertyAirTerminalTypeCommon.AddEntry(PropertySetEntry.CreateEnumeratedValue("MountingType", PropertyType.Label,
                typeof(PSetAirTerminalTypeCommon_AirTerminalMountingType)));
            propertyAirTerminalTypeCommon.AddEntry(PropertySetEntry.CreateEnumeratedValue("CoreType", PropertyType.Label,
                typeof(PSetAirTerminalTypeCommon_AirTerminalCoreType)));
            propertyAirTerminalTypeCommon.AddEntry(PropertySetEntry.CreatePlaneAngle("CoreSetHorizontal"));
            propertyAirTerminalTypeCommon.AddEntry(PropertySetEntry.CreatePlaneAngle("CoreSetVertical"));
            propertyAirTerminalTypeCommon.AddEntry(PropertySetEntry.CreateBoolean("HasIntegralControl"));
            propertyAirTerminalTypeCommon.AddEntry(PropertySetEntry.CreateEnumeratedValue("FlowControlType", PropertyType.Label,
                typeof(PSetAirTerminalTypeCommon_AirTerminalFlowControlType)));
            propertyAirTerminalTypeCommon.AddEntry(PropertySetEntry.CreateBoolean("HasSoundAttenuator"));
            propertyAirTerminalTypeCommon.AddEntry(PropertySetEntry.CreateBoolean("HasThermalInsulation"));
            propertyAirTerminalTypeCommon.AddEntry(PropertySetEntry.CreateArea("NeckArea"));
            propertyAirTerminalTypeCommon.AddEntry(PropertySetEntry.CreateArea("EffectiveArea"));

            if (ExporterCacheManager.ExportOptionsCache.ExportAs4)
            {
                PropertySetEntry ifcPSE = PropertySetEntryUtil.CreateReferenceEntry();
                propertyAirTerminalTypeCommon.AddEntry(ifcPSE);
                propertyAirTerminalTypeCommon.AddEntry(PropertySetEntryUtil.CreateStatusEntry());
                propertyAirTerminalTypeCommon.AddEntry(PropertySetEntry.CreateLabel("FaceType"));
                propertyAirTerminalTypeCommon.AddEntry(PropertySetEntry.CreateLength("SlotWidth"));
                propertyAirTerminalTypeCommon.AddEntry(PropertySetEntry.CreateLength("SlotLength"));
                propertyAirTerminalTypeCommon.AddEntry(PropertySetEntry.CreateInteger("NumberOfSlots"));
                propertyAirTerminalTypeCommon.AddEntry(PropertySetEntry.CreatePositiveRatio("AirFlowrateVersusFlowControlElement"));
            }
            //propertyAirTerminalTypeCommon.AddEntry(PropertySetEntry.CreateMass("Weight"));
            //AirFlowrateVersusFlowControlElement: IfcPropertyTableValue not supported.

            commonPropertySets.Add(propertyAirTerminalTypeCommon);
        }
        /// <summary>
        /// Initializes COBIE photo voltaic array property sets.
        /// </summary>
        /// <param name="cobiePropertySets">List to store property sets.</param>
        private static void InitCOBIEPSetPhotovoltaicArray(IList<PropertySetDescription> cobiePropertySets)
        {
            PropertySetDescription propertySetPhotovoltaicArray = new PropertySetDescription();
            propertySetPhotovoltaicArray.Name = "ePset_PhotovoltaicArray";
            propertySetPhotovoltaicArray.EntityTypes.Add(IFCEntityType.IfcRoof);
            propertySetPhotovoltaicArray.EntityTypes.Add(IFCEntityType.IfcWall);
            propertySetPhotovoltaicArray.EntityTypes.Add(IFCEntityType.IfcSlab);

            PropertySetEntry ifcPSE = PropertySetEntry.CreateBoolean("Hosts Photovoltaic Array");
            ifcPSE.PropertyName = "HostsPhotovoltaicArray";
            propertySetPhotovoltaicArray.AddEntry(ifcPSE);

            ifcPSE = PropertySetEntry.CreateReal("Active Area Ratio");
            ifcPSE.PropertyName = "ActiveAreaRatio";
            propertySetPhotovoltaicArray.AddEntry(ifcPSE);

            ifcPSE = PropertySetEntry.CreateReal("DC to AC Conversion Efficiency");
            ifcPSE.PropertyName = "DcToAcConversionEfficiency";
            propertySetPhotovoltaicArray.AddEntry(ifcPSE);

            ifcPSE = PropertySetEntry.CreateLabel("Photovoltaic Surface Integration");
            ifcPSE.PropertyName = "PhotovoltaicSurfaceIntegration";
            propertySetPhotovoltaicArray.AddEntry(ifcPSE);

            ifcPSE = PropertySetEntry.CreateReal("Photovoltaic Cell Efficiency");
            ifcPSE.PropertyName = "PhotovoltaicCellEfficiency";
            propertySetPhotovoltaicArray.AddEntry(ifcPSE);

            cobiePropertySets.Add(propertySetPhotovoltaicArray);
        }
Beispiel #29
0
 /// <summary>
 /// Some elements may not have the right structure to support stable GUIDs for some property sets.  Ignore the index for these cases.
 /// </summary>
 private static int CheckElementTypeValidityForSubIndex(PropertySetDescription currDesc, IFCAnyHandle handle, Element element)
 {
     int originalIndex = currDesc.SubElementIndex;
     if (originalIndex > 0)
     {
         if (IFCAnyHandleUtil.IsSubTypeOf(handle, IFCEntityType.IfcSlab) || IFCAnyHandleUtil.IsSubTypeOf(handle, IFCEntityType.IfcStairFlight))
         {
             if (StairsExporter.IsLegacyStairs(element))
             {
                 return 0;
             }
         }
     }
     return originalIndex;
 }
        /// <summary>
        /// Initializes building water storage property sets.
        /// </summary>
        /// <param name="commonPropertySets">List to store property sets.</param>
        private static void InitPropertySetBuildingWaterStorage(IList<PropertySetDescription> commonPropertySets)
        {
            PropertySetDescription propertySetBuildingWaterStorage = new PropertySetDescription();
            propertySetBuildingWaterStorage.Name = "Pset_BuildingWaterStorage";
            propertySetBuildingWaterStorage.EntityTypes.Add(IFCEntityType.IfcBuilding);

            propertySetBuildingWaterStorage.AddEntry(PropertySetEntry.CreateReal("OneDayPotableWater"));
            propertySetBuildingWaterStorage.AddEntry(PropertySetEntry.CreateReal("OneDayProcessOrProductionWater"));
            propertySetBuildingWaterStorage.AddEntry(PropertySetEntry.CreateReal("OneDayCoolingTowerMakeupWater"));

            commonPropertySets.Add(propertySetBuildingWaterStorage);
        }