/// <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_ReinforcingBarBendingsBECCommon.
        /// </summary>
        /// <param name="commonPropertySets">List to store property sets.</param>
        private static void InitPropertySetReinforcingBarBendingsBECCommon(IList<PropertySetDescription> commonPropertySets)
        {
            PropertySetDescription propertySetReinforcingBarCommon = new PropertySetDescription();
            propertySetReinforcingBarCommon.Name = "Pset_ReinforcingBarBendingsBECCommon";
            propertySetReinforcingBarCommon.SubElementIndex = (int)IFCCommonPSets.PSetBECCommon;

            propertySetReinforcingBarCommon.EntityTypes.Add(IFCEntityType.IfcReinforcingBar);

            propertySetReinforcingBarCommon.AddEntry(PropertySetEntry.CreateLabel("BECBarShapeCode"));
            for (char shapeParameterSuffix = 'a'; shapeParameterSuffix <= 'l'; shapeParameterSuffix++)
                propertySetReinforcingBarCommon.AddEntry(PropertySetEntry.CreatePositiveLength("BECShapeParameter_" + shapeParameterSuffix.ToString()));
            propertySetReinforcingBarCommon.AddEntry(PropertySetEntry.CreatePlaneAngle("BECBendingParameter_u"));
            propertySetReinforcingBarCommon.AddEntry(PropertySetEntry.CreatePlaneAngle("BECBendingParameter_v"));
            propertySetReinforcingBarCommon.AddEntry(PropertySetEntry.CreatePlaneAngle("BECBendingParameter_ul"));
            propertySetReinforcingBarCommon.AddEntry(PropertySetEntry.CreatePlaneAngle("BECBendingParameter_vl"));
            propertySetReinforcingBarCommon.AddEntry(PropertySetEntry.CreatePositiveLength("BECShapeAid_x"));
            propertySetReinforcingBarCommon.AddEntry(PropertySetEntry.CreatePositiveLength("BECShapeAid_y"));
            propertySetReinforcingBarCommon.AddEntry(PropertySetEntry.CreatePositiveLength("BECRollerDiameter"));
            
            commonPropertySets.Add(propertySetReinforcingBarCommon);
        }
        /// <summary>
        /// Initializes Pset_ReinforcingBarBendingsISOCD3766Common.
        /// </summary>
        /// <param name="commonPropertySets">List to store property sets.</param>
        private static void InitPropertySetReinforcingBarBendingsISOCD3766Common(IList<PropertySetDescription> commonPropertySets)
        {
            PropertySetDescription propertySetReinforcingBarCommon = new PropertySetDescription();
            propertySetReinforcingBarCommon.Name = "Pset_ReinforcingBarBendingsISOCD3766Common";
            propertySetReinforcingBarCommon.SubElementIndex = (int)IFCCommonPSets.PSetISOCD3766Common;

            propertySetReinforcingBarCommon.EntityTypes.Add(IFCEntityType.IfcReinforcingBar);

            PropertySetEntry ifcPSE = PropertySetEntry.CreateLabel("ISOCD3766ShapeCode");
            ifcPSE.PropertyCalculator = ISOCD3766ShapeCodeCalculator.Instance;
            propertySetReinforcingBarCommon.AddEntry(ifcPSE);

            ifcPSE = PropertySetEntry.CreatePositiveLength("ISOCD3766ShapeParameter_a");
            ifcPSE.PropertyCalculator = ISOCD3766ShapeParameterACalculator.Instance;
            propertySetReinforcingBarCommon.AddEntry(ifcPSE);

            ifcPSE = PropertySetEntry.CreatePositiveLength("ISOCD3766ShapeParameter_b");
            ifcPSE.PropertyCalculator = ISOCD3766ShapeParameterBCalculator.Instance;
            propertySetReinforcingBarCommon.AddEntry(ifcPSE);

            ifcPSE = PropertySetEntry.CreatePositiveLength("ISOCD3766ShapeParameter_c");
            ifcPSE.PropertyCalculator = ISOCD3766ShapeParameterCCalculator.Instance;
            propertySetReinforcingBarCommon.AddEntry(ifcPSE);

            ifcPSE = PropertySetEntry.CreatePositiveLength("ISOCD3766ShapeParameter_d");
            ifcPSE.PropertyCalculator = ISOCD3766ShapeParameterDCalculator.Instance;
            propertySetReinforcingBarCommon.AddEntry(ifcPSE);

            ifcPSE = PropertySetEntry.CreatePositiveLength("ISOCD3766ShapeParameter_e");
            ifcPSE.PropertyCalculator = ISOCD3766ShapeParameterECalculator.Instance;
            propertySetReinforcingBarCommon.AddEntry(ifcPSE);

            ifcPSE = PropertySetEntry.CreatePositiveLength("ISOCD3766ShapeParameter_R");
            ifcPSE.PropertyCalculator = ISOCD3766BendingRadiusCalculator.Instance;
            propertySetReinforcingBarCommon.AddEntry(ifcPSE);

            ifcPSE = PropertySetEntry.CreatePlaneAngle("ISOCD3766BendingStartHook");
            ifcPSE.PropertyCalculator = ISOCD3766BendingStartHookCalculator.Instance;
            propertySetReinforcingBarCommon.AddEntry(ifcPSE);

            ifcPSE = PropertySetEntry.CreatePlaneAngle("ISOCD3766BendingEndHook");
            ifcPSE.PropertyCalculator = ISOCD3766BendingEndHookCalculator.Instance;
            propertySetReinforcingBarCommon.AddEntry(ifcPSE);
            
            commonPropertySets.Add(propertySetReinforcingBarCommon);
        }
        /// <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 IfcMember property sets.
        /// </summary>
        /// <param name="commonPropertySets">List to store property sets.</param>
        /// <remarks>Reuses beam calculators for some values.</remarks>
        private static void InitPropertySetMemberCommon(IList<PropertySetDescription> commonPropertySets)
        {
            //property beam common
            PropertySetDescription propertySetMemberCommon = new PropertySetDescription();
            propertySetMemberCommon.Name = "Pset_MemberCommon";
            propertySetMemberCommon.SubElementIndex = (int)IFCCommonPSets.PSetMemberCommon;

            propertySetMemberCommon.EntityTypes.Add(IFCEntityType.IfcMember);

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

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

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

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

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

            ifcPSE = PropertySetEntry.CreatePlaneAngle("Slope");
            ifcPSE.PropertyCalculator = BeamSlopeCalculator.Instance;
            propertySetMemberCommon.AddEntry(ifcPSE);

            commonPropertySets.Add(propertySetMemberCommon);
        }
        /// <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"));
            propertySetLightFixtureTypeCommon.AddEntry(PropertySetEntry.CreateText("ManufacturersSpecificInformation"));

            // 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"));

            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 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 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 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, IFCVersion fileVersion)
        {
            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);

            int unnamedScheduleIndex = 1;
            foreach (ViewSchedule schedule in viewScheduleElementCollector)
            {
                //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.IfcElement);
                
                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 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)));
                propertySetSwitchingDeviceTypeToggleSwitch.AddEntry(PropertySetEntry.CreateBoolean("IsIlluminated"));
                propertySetSwitchingDeviceTypeToggleSwitch.AddEntry(PropertySetEntry.CreateLabel("Legend"));

            commonPropertySets.Add(propertySetSwitchingDeviceTypeToggleSwitch);
        }
        /// <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"));

            commonPropertySets.Add(propertySetSwitchingDeviceTypeCommon);
        }
        /// <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_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"));
                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 common covering property sets.
        /// </summary>
        /// <param name="commonPropertySets">List to store property sets.</param>
        private static void InitPropertySetCoveringCommon(IList<PropertySetDescription> commonPropertySets, IFCVersion fileVersion)
        {
            //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 (fileVersion == IFCVersion.IFC2x2)
                propertySetCoveringCommon.AddEntry(PropertySetEntry.CreateLabel("Fragility"));
            else
                propertySetCoveringCommon.AddEntry(PropertySetEntry.CreateLabel("FragilityRating"));

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

                ifcPSE = PropertySetEntry.CreatePositiveLength("TotalThickness");
                ifcPSE.RevitBuiltInParameter = BuiltInParameter.CEILING_THICKNESS;
                propertySetCoveringCommon.AddEntry(ifcPSE);

            commonPropertySets.Add(propertySetCoveringCommon);
        }
        /// <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 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"));

            commonPropertySets.Add(propertySetWindowCommon);
        }
        /// <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_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 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_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.CreateElectricalCurrent("NominalCurrent"));
            propertySetElectricalDeviceCommon.AddEntry(PropertySetEntry.CreateElectricalCurrent("UsageCurrent"));
            propertySetElectricalDeviceCommon.AddEntry(PropertySetEntry.CreateElectricalVoltage("NominalVoltage"));
            propertySetElectricalDeviceCommon.AddEntry(PropertySetEntry.CreatePower("ElectricalDeviceNominalPower"));
            propertySetElectricalDeviceCommon.AddEntry(PropertySetEntry.CreateInteger("NumberOfPoles"));
            propertySetElectricalDeviceCommon.AddEntry(PropertySetEntry.CreateBoolean("HasProtectiveEarth"));
            propertySetElectricalDeviceCommon.AddEntry(PropertySetEntry.CreateFrequency("NominalFrequencyRange"));
            propertySetElectricalDeviceCommon.AddEntry(PropertySetEntry.CreatePositivePlaneAngle("PhaseAngle"));
            propertySetElectricalDeviceCommon.AddEntry(PropertySetEntry.CreateLabel("IP_Code"));
            propertySetElectricalDeviceCommon.AddEntry(PropertySetEntry.CreateEnumeratedValue("InsulationStandardClass",
                PropertyType.Label, typeof(PSetElectricalDeviceCommon_InsulationStandardClass)));
                propertySetElectricalDeviceCommon.AddEntry(PropertySetEntry.CreateIdentifier("PhaseReference"));

            commonPropertySets.Add(propertySetElectricalDeviceCommon);
        }
        /// <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);
        }
        /// <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"));
            //propertyAirTerminalTypeCommon.AddEntry(PropertySetEntry.CreateMass("Weight"));
            //AirFlowrateVersusFlowControlElement: IfcPropertyTableValue not supported.
            
            commonPropertySets.Add(propertyAirTerminalTypeCommon);
        }
        /// <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);

            commonPropertySets.Add(propertySetManufacturer);
        }
        /// <summary>
        /// Initializes Pset_PlateCommon.
        /// </summary>
        /// <param name="commonPropertySets">List to store property sets.</param>
        /// <remarks>Reuses BeamLoadBearingCalculator for load bearing calculation.</remarks>
        private static void InitPropertySetPlateCommon(IList<PropertySetDescription> commonPropertySets)
        {
            PropertySetDescription propertySetPlateCommon = new PropertySetDescription();
            propertySetPlateCommon.Name = "Pset_PlateCommon";
            propertySetPlateCommon.SubElementIndex = (int)IFCCommonPSets.PSetPlateCommon;

            propertySetPlateCommon.EntityTypes.Add(IFCEntityType.IfcPlate);

            propertySetPlateCommon.AddEntry(PropertySetEntryUtil.CreateReferenceEntry());
            propertySetPlateCommon.AddEntry(PropertySetEntryUtil.CreateIsExternalEntry());
            propertySetPlateCommon.AddEntry(PropertySetEntryUtil.CreateLoadBearingEntry(BeamLoadBearingCalculator.Instance));
            propertySetPlateCommon.AddEntry(PropertySetEntryUtil.CreateAcousticRatingEntry());
            propertySetPlateCommon.AddEntry(PropertySetEntryUtil.CreateFireRatingEntry());
            propertySetPlateCommon.AddEntry(PropertySetEntryUtil.CreateThermalTransmittanceEntry());

            commonPropertySets.Add(propertySetPlateCommon);
        }
        /// <summary>
        /// Initializes common wall property sets.
        /// </summary>
        /// <param name="commonPropertySets">List to store property sets.</param>
        private static void InitPropertySetWallCommon(IList<PropertySetDescription> commonPropertySets)
        {
            //property set wall common
            PropertySetDescription propertySetWallCommon = new PropertySetDescription();
            propertySetWallCommon.Name = "Pset_WallCommon";
            propertySetWallCommon.SubElementIndex = (int)IFCCommonPSets.PSetWallCommon;

            propertySetWallCommon.EntityTypes.Add(IFCEntityType.IfcWall);

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

            ifcPSE = PropertySetEntryUtil.CreateLoadBearingEntry(LoadBearingCalculator.Instance);
            propertySetWallCommon.AddEntry(ifcPSE);

            ifcPSE = PropertySetEntryUtil.CreateExtendToStructureEntry();
            propertySetWallCommon.AddEntry(ifcPSE);

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

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

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

            propertySetWallCommon.AddEntry(PropertySetEntryUtil.CreateAcousticRatingEntry());
            propertySetWallCommon.AddEntry(PropertySetEntryUtil.CreateSurfaceSpreadOfFlameEntry());
            propertySetWallCommon.AddEntry(PropertySetEntryUtil.CreateCombustibleEntry());
            propertySetWallCommon.AddEntry(PropertySetEntryUtil.CreateCompartmentationEntry());

            commonPropertySets.Add(propertySetWallCommon);
        }
        /// <summary>
        /// Initializes Pset_ReinforcingBarBendingsDIN135610Common.
        /// </summary>
        /// <param name="commonPropertySets">List to store property sets.</param>
        private static void InitPropertySetReinforcingBarBendingsDIN135610Common(IList<PropertySetDescription> commonPropertySets)
        {
            PropertySetDescription propertySetReinforcingBarCommon = new PropertySetDescription();
            propertySetReinforcingBarCommon.Name = "Pset_ReinforcingBarBendingsDIN135610Common";
            propertySetReinforcingBarCommon.SubElementIndex = (int)IFCCommonPSets.PSetDIN135610Common;

            propertySetReinforcingBarCommon.EntityTypes.Add(IFCEntityType.IfcReinforcingBar);

            propertySetReinforcingBarCommon.AddEntry(PropertySetEntry.CreateLabel("DIN135610ShapeCode"));
            for (char shapeParameterSuffix = 'a'; shapeParameterSuffix <= 'e'; shapeParameterSuffix++)
                propertySetReinforcingBarCommon.AddEntry(PropertySetEntry.CreatePositiveLength("DIN135610ShapeParameter_" + shapeParameterSuffix.ToString()));
            propertySetReinforcingBarCommon.AddEntry(PropertySetEntry.CreatePositiveLength("DIN135610ShapeParameter_z"));

            commonPropertySets.Add(propertySetReinforcingBarCommon);
        }
        /// <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());

            commonPropertySets.Add(propertySetCurtainWallCommon);
        }
        /// <summary>
        /// Initializes common column property sets.
        /// </summary>
        /// <param name="commonPropertySets">List to store property sets.</param>
        private static void InitPropertySetColumnCommon(IList<PropertySetDescription> commonPropertySets)
        {
            //property column common
            PropertySetDescription propertySetColumnCommon = new PropertySetDescription();
            propertySetColumnCommon.Name = "Pset_ColumnCommon";

            propertySetColumnCommon.EntityTypes.Add(IFCEntityType.IfcColumn);

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

            ifcPSE = PropertySetEntryUtil.CreateLoadBearingEntry(ColumnLoadBearingCalculator.Instance);
            propertySetColumnCommon.AddEntry(ifcPSE);

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

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

            ifcPSE = PropertySetEntry.CreatePlaneAngle("Slope");
            ifcPSE.PropertyCalculator = BeamSlopeCalculator.Instance;
            propertySetColumnCommon.AddEntry(ifcPSE);

            commonPropertySets.Add(propertySetColumnCommon);
        }
        /// <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);
        }