#3478 : Ifc class name suggestions can now autofill predefined type

If they are correctly filled in the json file :)
This commit is contained in:
Gorgious56
2023-07-20 19:40:31 +02:00
parent 99fd807805
commit 274f42993c
4 changed files with 138 additions and 19 deletions
@@ -64,16 +64,19 @@ SCHEMA_FILES = {
"entities": BASE_MODULE_PATH / "schema/ifc2x3_entities.json",
"properties": BASE_MODULE_PATH / "schema/ifc2x3_properties.json",
"types": BASE_MODULE_PATH / "schema/ifc2x3_types.json",
"classes_suggestions": BASE_MODULE_PATH / "schema/ifc_classes_suggestions.json",
},
"IFC4": {
"entities": BASE_MODULE_PATH / "schema/ifc4_entities.json",
"properties": BASE_MODULE_PATH / "schema/ifc4_properties.json",
"types": BASE_MODULE_PATH / "schema/ifc4_types.json",
"classes_suggestions": BASE_MODULE_PATH / "schema/ifc_classes_suggestions.json",
},
"IFC4X3": {
"entities": BASE_MODULE_PATH / "schema/ifc4x3_entities.json",
"properties": BASE_MODULE_PATH / "schema/ifc4x3_properties.json",
"types": BASE_MODULE_PATH / "schema/ifc4x3_types.json",
"classes_suggestions": BASE_MODULE_PATH / "schema/ifc_classes_suggestions.json",
},
}
@@ -105,6 +108,14 @@ def get_schema_by_name(version):
return schema_by_name[version]
def get_class_suggestions(version, class_name):
db = get_db(version)
if not db:
return
class_suggestions = db["classes_suggestions"].get(class_name)
return class_suggestions
def get_entity_doc(version, entity_name, recursive=True):
db = get_db(version)
if db:
@@ -0,0 +1,110 @@
{
"IfcActuator": [
{
"name": "Electric Strike",
"predefined_type": "NOTDEFINED"
}
],
"IfcAirTerminalBox": [
{
"name": "VAV Box",
"predefined_type": "NOTDEFINED"
}
],
"IfcCableSegment": [
{
"name": "Lighting Rod",
"predefined_type": "NOTDEFINED"
}
],
"IfcCovering": [
{
"name": "Flashing",
"predefined_type": "NOTDEFINED"
},
{
"name": "Capping",
"predefined_type": "NOTDEFINED"
}
],
"IfcFurniture": [
{
"name": "Signage",
"predefined_type": "NOTDEFINED"
}
],
"IfcPlate": [
{
"name": "Glazing",
"predefined_type": "NOTDEFINED"
},
{
"name": "Glass",
"predefined_type": "NOTDEFINED"
},
{
"name": "Pane",
"predefined_type": "NOTDEFINED"
}
],
"IfcSensor": [
{
"name": "Card Reader",
"predefined_type": "NOTDEFINED"
},
{
"name": "Fob Reader",
"predefined_type": "NOTDEFINED"
}
],
"IfcSlab": [
{
"name": "Hob",
"predefined_type": "NOTDEFINED"
}
],
"IfcSwitchingDevice": [
{
"name": "Reed Switch",
"predefined_type": "NOTDEFINED"
},
{
"name": "Electric Isolating Switch",
"predefined_type": "NOTDEFINED"
}
],
"IfcUnitaryEquipment": [
{
"name": "Fan Coil Unit",
"predefined_type": "NOTDEFINED"
}
],
"IfcWall": [
{
"name": "Glazing",
"predefined_type": "NOTDEFINED"
},
{
"name": "Glass",
"predefined_type": "NOTDEFINED"
},
{
"name": "Pane",
"predefined_type": "NOTDEFINED"
}
],
"IfcWindow": [
{
"name": "Glazing",
"predefined_type": "NOTDEFINED"
},
{
"name": "Glass",
"predefined_type": "NOTDEFINED"
},
{
"name": "Pane",
"predefined_type": "NOTDEFINED"
}
]
}