Use schema_identifier to get IFC4X3 schema more precisely

This commit is contained in:
Andrej730
2025-03-14 14:49:19 +05:00
parent 9f78d9881e
commit 2f87029434
11 changed files with 17 additions and 16 deletions
@@ -56,7 +56,7 @@ class PsetTemplatesData:
ifc_file = IfcStore.pset_template_file
if not ifc_file:
return []
schema = ifcopenshell.ifcopenshell_wrapper.schema_by_name(ifc_file.schema)
schema = ifcopenshell.schema_by_name(ifc_file.schema)
version = ifc_file.schema
enum_items = [
(t, t, ifcopenshell.util.doc.get_type_doc(version, t).get("description", ""))
@@ -97,7 +97,7 @@ class PsetTemplatesData:
# If mixed typed are used (e.g. during transition), assume type is not specified.
pset_type = next(iter(pset_types)) if len(pset_types) == 1 else None
schema = ifcopenshell.ifcopenshell_wrapper.schema_by_name(ifc_file.schema)
schema = ifcopenshell.schema_by_name(ifc_file.schema)
attribute = schema.declaration_by_name("IfcSimplePropertyTemplate").attributes()[0]
enum_items = [
a
@@ -24,7 +24,7 @@ import ifcopenshell.util.schema
def generate_ifc4_entity_map(filepath, schema_name, manual_corrections={}):
filepath = filepath
schema = ifcopenshell.ifcopenshell_wrapper.schema_by_name(schema_name)
schema = ifcopenshell.schema_by_name(schema_name)
entity_to_type_map = {}
@@ -154,7 +154,7 @@ ifc4x3_corrections = {
"IfcDistributionElement": ["IfcDistributionElementType"],
"IfcBuiltElement": ["IfcBuiltElementType"],
}
entity_to_type_map4x3 = generate_ifc4_entity_map("IFC4X3_TC1.exp", "ifc4x3", ifc4x3_corrections)
entity_to_type_map4x3 = generate_ifc4_entity_map("IFC4X3_TC1.exp", "IFC4X3", ifc4x3_corrections)
# some manual IFC4 corrections (more details in entity_to_type_map_4.json commits history)
ifc4_corrections = {
@@ -165,6 +165,6 @@ ifc4_corrections = {
"IfcDistributionElement": ["IfcDistributionElementType"],
}
#
entity_to_type_map4 = generate_ifc4_entity_map("IFC4.exp", "ifc4", ifc4_corrections)
entity_to_type_map4 = generate_ifc4_entity_map("IFC4.exp", "IFC4", ifc4_corrections)
entity_to_type_map2x3 = generate_ifc2x3_entity_map()