Fix bug where you couldn't add type instances for IFC4

This commit is contained in:
Dion Moult
2021-04-01 15:03:42 +11:00
parent 76568ea67c
commit 0387c778f4
2 changed files with 117 additions and 113 deletions
@@ -24,6 +24,10 @@ with open(filepath) as fp:
is_in_where_rule = True is_in_where_rule = True
elif entity and is_in_where_rule and "IN TYPEOF" in line and "RelatingType" in line: elif entity and is_in_where_rule and "IN TYPEOF" in line and "RelatingType" in line:
type_class = line.split("'")[1].split(".")[1] type_class = line.split("'")[1].split(".")[1]
if type_class == "IFCTRANFORMERTYPE":
# Fix typo in schema
type_class = "IFCTRANSFORMERTYPE"
type_class = schema4.declaration_by_name(type_class).name()
entity_to_type_map.setdefault(entity, []).append(type_class) entity_to_type_map.setdefault(entity, []).append(type_class)
line = fp.readline() line = fp.readline()
@@ -1,341 +1,341 @@
{ {
"IfcActuator": [ "IfcActuator": [
"IFCACTUATORTYPE" "IfcActuatorType"
], ],
"IfcAirTerminal": [ "IfcAirTerminal": [
"IFCAIRTERMINALTYPE" "IfcAirTerminalType"
], ],
"IfcAirTerminalBox": [ "IfcAirTerminalBox": [
"IFCAIRTERMINALBOXTYPE" "IfcAirTerminalBoxType"
], ],
"IfcAirToAirHeatRecovery": [ "IfcAirToAirHeatRecovery": [
"IFCAIRTOAIRHEATRECOVERYTYPE" "IfcAirToAirHeatRecoveryType"
], ],
"IfcAlarm": [ "IfcAlarm": [
"IFCALARMTYPE" "IfcAlarmType"
], ],
"IfcAudioVisualAppliance": [ "IfcAudioVisualAppliance": [
"IFCAUDIOVISUALAPPLIANCETYPE" "IfcAudioVisualApplianceType"
], ],
"IfcBeam": [ "IfcBeam": [
"IFCBEAMTYPE" "IfcBeamType"
], ],
"IfcBoiler": [ "IfcBoiler": [
"IFCBOILERTYPE" "IfcBoilerType"
], ],
"IfcBuildingElementPart": [ "IfcBuildingElementPart": [
"IFCBUILDINGELEMENTPARTTYPE" "IfcBuildingElementPartType"
], ],
"IfcBuildingElementProxy": [ "IfcBuildingElementProxy": [
"IFCBUILDINGELEMENTPROXYTYPE" "IfcBuildingElementProxyType"
], ],
"IfcBurner": [ "IfcBurner": [
"IFCBURNERTYPE" "IfcBurnerType"
], ],
"IfcCableCarrierFitting": [ "IfcCableCarrierFitting": [
"IFCCABLECARRIERFITTINGTYPE" "IfcCableCarrierFittingType"
], ],
"IfcCableCarrierSegment": [ "IfcCableCarrierSegment": [
"IFCCABLECARRIERSEGMENTTYPE" "IfcCableCarrierSegmentType"
], ],
"IfcCableFitting": [ "IfcCableFitting": [
"IFCCABLEFITTINGTYPE" "IfcCableFittingType"
], ],
"IfcCableSegment": [ "IfcCableSegment": [
"IFCCABLESEGMENTTYPE" "IfcCableSegmentType"
], ],
"IfcChiller": [ "IfcChiller": [
"IFCCHILLERTYPE" "IfcChillerType"
], ],
"IfcChimney": [ "IfcChimney": [
"IFCCHIMNEYTYPE" "IfcChimneyType"
], ],
"IfcCoil": [ "IfcCoil": [
"IFCCOILTYPE" "IfcCoilType"
], ],
"IfcColumn": [ "IfcColumn": [
"IFCCOLUMNTYPE" "IfcColumnType"
], ],
"IfcCommunicationsAppliance": [ "IfcCommunicationsAppliance": [
"IFCCOMMUNICATIONSAPPLIANCETYPE" "IfcCommunicationsApplianceType"
], ],
"IfcCompressor": [ "IfcCompressor": [
"IFCCOMPRESSORTYPE" "IfcCompressorType"
], ],
"IfcCondenser": [ "IfcCondenser": [
"IFCCONDENSERTYPE" "IfcCondenserType"
], ],
"IfcController": [ "IfcController": [
"IFCCONTROLLERTYPE" "IfcControllerType"
], ],
"IfcCooledBeam": [ "IfcCooledBeam": [
"IFCCOOLEDBEAMTYPE" "IfcCooledBeamType"
], ],
"IfcCoolingTower": [ "IfcCoolingTower": [
"IFCCOOLINGTOWERTYPE" "IfcCoolingTowerType"
], ],
"IfcCovering": [ "IfcCovering": [
"IFCCOVERINGTYPE" "IfcCoveringType"
], ],
"IfcCurtainWall": [ "IfcCurtainWall": [
"IFCCURTAINWALLTYPE" "IfcCurtainWallType"
], ],
"IfcDamper": [ "IfcDamper": [
"IFCDAMPERTYPE" "IfcDamperType"
], ],
"IfcDiscreteAccessory": [ "IfcDiscreteAccessory": [
"IFCDISCRETEACCESSORYTYPE" "IfcDiscreteAccessoryType"
], ],
"IfcDistributionChamberElement": [ "IfcDistributionChamberElement": [
"IFCDISTRIBUTIONCHAMBERELEMENTTYPE" "IfcDistributionChamberElementType"
], ],
"IfcDoor": [ "IfcDoor": [
"IFCDOORTYPE" "IfcDoorType"
], ],
"IfcDuctFitting": [ "IfcDuctFitting": [
"IFCDUCTFITTINGTYPE" "IfcDuctFittingType"
], ],
"IfcDuctSegment": [ "IfcDuctSegment": [
"IFCDUCTSEGMENTTYPE" "IfcDuctSegmentType"
], ],
"IfcDuctSilencer": [ "IfcDuctSilencer": [
"IFCDUCTSILENCERTYPE" "IfcDuctSilencerType"
], ],
"IfcElectricAppliance": [ "IfcElectricAppliance": [
"IFCELECTRICAPPLIANCETYPE" "IfcElectricApplianceType"
], ],
"IfcElectricDistributionBoard": [ "IfcElectricDistributionBoard": [
"IFCELECTRICDISTRIBUTIONBOARDTYPE" "IfcElectricDistributionBoardType"
], ],
"IfcElectricFlowStorageDevice": [ "IfcElectricFlowStorageDevice": [
"IFCELECTRICFLOWSTORAGEDEVICETYPE" "IfcElectricFlowStorageDeviceType"
], ],
"IfcElectricGenerator": [ "IfcElectricGenerator": [
"IFCELECTRICGENERATORTYPE" "IfcElectricGeneratorType"
], ],
"IfcElectricMotor": [ "IfcElectricMotor": [
"IFCELECTRICMOTORTYPE" "IfcElectricMotorType"
], ],
"IfcElectricTimeControl": [ "IfcElectricTimeControl": [
"IFCELECTRICTIMECONTROLTYPE" "IfcElectricTimeControlType"
], ],
"IfcElementAssembly": [ "IfcElementAssembly": [
"IFCELEMENTASSEMBLYTYPE" "IfcElementAssemblyType"
], ],
"IfcEngine": [ "IfcEngine": [
"IFCENGINETYPE" "IfcEngineType"
], ],
"IfcEvaporativeCooler": [ "IfcEvaporativeCooler": [
"IFCEVAPORATIVECOOLERTYPE" "IfcEvaporativeCoolerType"
], ],
"IfcEvaporator": [ "IfcEvaporator": [
"IFCEVAPORATORTYPE" "IfcEvaporatorType"
], ],
"IfcFan": [ "IfcFan": [
"IFCFANTYPE" "IfcFanType"
], ],
"IfcFastener": [ "IfcFastener": [
"IFCFASTENERTYPE" "IfcFastenerType"
], ],
"IfcFilter": [ "IfcFilter": [
"IFCFILTERTYPE" "IfcFilterType"
], ],
"IfcFireSuppressionTerminal": [ "IfcFireSuppressionTerminal": [
"IFCFIRESUPPRESSIONTERMINALTYPE" "IfcFireSuppressionTerminalType"
], ],
"IfcFlowInstrument": [ "IfcFlowInstrument": [
"IFCFLOWINSTRUMENTTYPE" "IfcFlowInstrumentType"
], ],
"IfcFlowMeter": [ "IfcFlowMeter": [
"IFCFLOWMETERTYPE" "IfcFlowMeterType"
], ],
"IfcFooting": [ "IfcFooting": [
"IFCFOOTINGTYPE" "IfcFootingType"
], ],
"IfcFurniture": [ "IfcFurniture": [
"IFCFURNITURETYPE" "IfcFurnitureType"
], ],
"IfcGeographicElement": [ "IfcGeographicElement": [
"IFCGEOGRAPHICELEMENTTYPE" "IfcGeographicElementType"
], ],
"IfcHeatExchanger": [ "IfcHeatExchanger": [
"IFCHEATEXCHANGERTYPE" "IfcHeatExchangerType"
], ],
"IfcHumidifier": [ "IfcHumidifier": [
"IFCHUMIDIFIERTYPE" "IfcHumidifierType"
], ],
"IfcInterceptor": [ "IfcInterceptor": [
"IFCINTERCEPTORTYPE" "IfcInterceptorType"
], ],
"IfcJunctionBox": [ "IfcJunctionBox": [
"IFCJUNCTIONBOXTYPE" "IfcJunctionBoxType"
], ],
"IfcLamp": [ "IfcLamp": [
"IFCLAMPTYPE" "IfcLampType"
], ],
"IfcLightFixture": [ "IfcLightFixture": [
"IFCLIGHTFIXTURETYPE" "IfcLightFixtureType"
], ],
"IfcMechanicalFastener": [ "IfcMechanicalFastener": [
"IFCMECHANICALFASTENERTYPE" "IfcMechanicalFastenerType"
], ],
"IfcMedicalDevice": [ "IfcMedicalDevice": [
"IFCMEDICALDEVICETYPE" "IfcMedicalDeviceType"
], ],
"IfcMember": [ "IfcMember": [
"IFCMEMBERTYPE" "IfcMemberType"
], ],
"IfcMotorConnection": [ "IfcMotorConnection": [
"IFCMOTORCONNECTIONTYPE" "IfcMotorConnectionType"
], ],
"IfcOutlet": [ "IfcOutlet": [
"IFCOUTLETTYPE" "IfcOutletType"
], ],
"IfcPile": [ "IfcPile": [
"IFCPILETYPE" "IfcPileType"
], ],
"IfcPipeFitting": [ "IfcPipeFitting": [
"IFCPIPEFITTINGTYPE" "IfcPipeFittingType"
], ],
"IfcPipeSegment": [ "IfcPipeSegment": [
"IFCPIPESEGMENTTYPE" "IfcPipeSegmentType"
], ],
"IfcPlate": [ "IfcPlate": [
"IFCPLATETYPE" "IfcPlateType"
], ],
"IfcProtectiveDevice": [ "IfcProtectiveDevice": [
"IFCPROTECTIVEDEVICETYPE" "IfcProtectiveDeviceType"
], ],
"IfcProtectiveDeviceTrippingUnit": [ "IfcProtectiveDeviceTrippingUnit": [
"IFCPROTECTIVEDEVICETRIPPINGUNITTYPE" "IfcProtectiveDeviceTrippingUnitType"
], ],
"IfcPump": [ "IfcPump": [
"IFCPUMPTYPE" "IfcPumpType"
], ],
"IfcRailing": [ "IfcRailing": [
"IFCRAILINGTYPE" "IfcRailingType"
], ],
"IfcRamp": [ "IfcRamp": [
"IFCRAMPTYPE" "IfcRampType"
], ],
"IfcRampFlight": [ "IfcRampFlight": [
"IFCRAMPFLIGHTTYPE" "IfcRampFlightType"
], ],
"IfcReinforcingBar": [ "IfcReinforcingBar": [
"IFCREINFORCINGBARTYPE" "IfcReinforcingBarType"
], ],
"IfcReinforcingMesh": [ "IfcReinforcingMesh": [
"IFCREINFORCINGMESHTYPE" "IfcReinforcingMeshType"
], ],
"IfcRoof": [ "IfcRoof": [
"IFCROOFTYPE" "IfcRoofType"
], ],
"IfcSanitaryTerminal": [ "IfcSanitaryTerminal": [
"IFCSANITARYTERMINALTYPE" "IfcSanitaryTerminalType"
], ],
"IfcSensor": [ "IfcSensor": [
"IFCSENSORTYPE" "IfcSensorType"
], ],
"IfcShadingDevice": [ "IfcShadingDevice": [
"IFCSHADINGDEVICETYPE" "IfcShadingDeviceType"
], ],
"IfcSlab": [ "IfcSlab": [
"IFCSLABTYPE" "IfcSlabType"
], ],
"IfcSolarDevice": [ "IfcSolarDevice": [
"IFCSOLARDEVICETYPE" "IfcSolarDeviceType"
], ],
"IfcSpace": [ "IfcSpace": [
"IFCSPACETYPE" "IfcSpaceType"
], ],
"IfcSpaceHeater": [ "IfcSpaceHeater": [
"IFCSPACEHEATERTYPE" "IfcSpaceHeaterType"
], ],
"IfcSpatialZone": [ "IfcSpatialZone": [
"IFCSPATIALZONETYPE" "IfcSpatialZoneType"
], ],
"IfcStackTerminal": [ "IfcStackTerminal": [
"IFCSTACKTERMINALTYPE" "IfcStackTerminalType"
], ],
"IfcStair": [ "IfcStair": [
"IFCSTAIRTYPE" "IfcStairType"
], ],
"IfcStairFlight": [ "IfcStairFlight": [
"IFCSTAIRFLIGHTTYPE" "IfcStairFlightType"
], ],
"IfcSwitchingDevice": [ "IfcSwitchingDevice": [
"IFCSWITCHINGDEVICETYPE" "IfcSwitchingDeviceType"
], ],
"IfcSystemFurnitureElement": [ "IfcSystemFurnitureElement": [
"IFCSYSTEMFURNITUREELEMENTTYPE" "IfcSystemFurnitureElementType"
], ],
"IfcTank": [ "IfcTank": [
"IFCTANKTYPE" "IfcTankType"
], ],
"IfcTendon": [ "IfcTendon": [
"IFCTENDONTYPE" "IfcTendonType"
], ],
"IfcTendonAnchor": [ "IfcTendonAnchor": [
"IFCTENDONANCHORTYPE" "IfcTendonAnchorType"
], ],
"IfcTransformer": [ "IfcTransformer": [
"IFCTRANSFORMERTYPE" "IfcTransformerType"
], ],
"IfcTransportElement": [ "IfcTransportElement": [
"IFCTRANSPORTELEMENTTYPE" "IfcTransportElementType"
], ],
"IfcTubeBundle": [ "IfcTubeBundle": [
"IFCTUBEBUNDLETYPE" "IfcTubeBundleType"
], ],
"IfcUnitaryControlElement": [ "IfcUnitaryControlElement": [
"IFCUNITARYCONTROLELEMENTTYPE" "IfcUnitaryControlElementType"
], ],
"IfcUnitaryEquipment": [ "IfcUnitaryEquipment": [
"IFCUNITARYEQUIPMENTTYPE" "IfcUnitaryEquipmentType"
], ],
"IfcValve": [ "IfcValve": [
"IFCVALVETYPE" "IfcValveType"
], ],
"IfcVibrationIsolator": [ "IfcVibrationIsolator": [
"IFCVIBRATIONISOLATORTYPE" "IfcVibrationIsolatorType"
], ],
"IfcWall": [ "IfcWall": [
"IFCWALLTYPE" "IfcWallType"
], ],
"IfcWasteTerminal": [ "IfcWasteTerminal": [
"IFCWASTETERMINALTYPE" "IfcWasteTerminalType"
], ],
"IfcWindow": [ "IfcWindow": [
"IFCWINDOWTYPE" "IfcWindowType"
], ],
"IfcBeamStandardCase": [ "IfcBeamStandardCase": [
"IFCBEAMTYPE" "IfcBeamType"
], ],
"IfcColumnStandardCase": [ "IfcColumnStandardCase": [
"IFCCOLUMNTYPE" "IfcColumnType"
], ],
"IfcDoorStandardCase": [ "IfcDoorStandardCase": [
"IFCDOORTYPE" "IfcDoorType"
], ],
"IfcMemberStandardCase": [ "IfcMemberStandardCase": [
"IFCMEMBERTYPE" "IfcMemberType"
], ],
"IfcPlateStandardCase": [ "IfcPlateStandardCase": [
"IFCPLATETYPE" "IfcPlateType"
], ],
"IfcSlabElementedCase": [ "IfcSlabElementedCase": [
"IFCSLABTYPE" "IfcSlabType"
], ],
"IfcSlabStandardCase": [ "IfcSlabStandardCase": [
"IFCSLABTYPE" "IfcSlabType"
], ],
"IfcWallElementedCase": [ "IfcWallElementedCase": [
"IFCWALLTYPE" "IfcWallType"
], ],
"IfcWallStandardCase": [ "IfcWallStandardCase": [
"IFCWALLTYPE" "IfcWallType"
], ],
"IfcWindowStandardCase": [ "IfcWindowStandardCase": [
"IFCWINDOWTYPE" "IfcWindowType"
] ]
} }