mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-19 14:41:25 +00:00
fix errors appending related materials in ifc2x3
it wasn't processing materials properties correctly because it was expecting material to have class IfcMaterialDefinition
This commit is contained in:
@@ -129,6 +129,8 @@ class Usecase:
|
|||||||
self.added_elements: dict[int, ifcopenshell.entity_instance] = {}
|
self.added_elements: dict[int, ifcopenshell.entity_instance] = {}
|
||||||
self.reuse_identities: dict[int, ifcopenshell.entity_instance] = self.settings["reuse_identities"]
|
self.reuse_identities: dict[int, ifcopenshell.entity_instance] = self.settings["reuse_identities"]
|
||||||
self.whitelisted_inverse_attributes = {}
|
self.whitelisted_inverse_attributes = {}
|
||||||
|
self.base_material_class = "IfcMaterial" if self.file.schema == "IFC2X3" else "IfcMaterialDefinition"
|
||||||
|
|
||||||
if self.settings["element"].is_a("IfcTypeProduct"):
|
if self.settings["element"].is_a("IfcTypeProduct"):
|
||||||
self.target_class = "IfcTypeProduct"
|
self.target_class = "IfcTypeProduct"
|
||||||
return self.append_type_product()
|
return self.append_type_product()
|
||||||
@@ -179,7 +181,7 @@ class Usecase:
|
|||||||
def append_type_product(self):
|
def append_type_product(self):
|
||||||
self.whitelisted_inverse_attributes = {
|
self.whitelisted_inverse_attributes = {
|
||||||
"IfcObjectDefinition": ["HasAssociations"],
|
"IfcObjectDefinition": ["HasAssociations"],
|
||||||
"IfcMaterialDefinition": ["HasExternalReferences", "HasProperties", "HasRepresentation"],
|
self.base_material_class: ["HasExternalReferences", "HasProperties", "HasRepresentation"],
|
||||||
"IfcRepresentationItem": ["StyledByItem"],
|
"IfcRepresentationItem": ["StyledByItem"],
|
||||||
}
|
}
|
||||||
self.existing_contexts = self.file.by_type("IfcGeometricRepresentationContext")
|
self.existing_contexts = self.file.by_type("IfcGeometricRepresentationContext")
|
||||||
@@ -192,7 +194,7 @@ class Usecase:
|
|||||||
"IfcObjectDefinition": ["HasAssociations"],
|
"IfcObjectDefinition": ["HasAssociations"],
|
||||||
"IfcObject": ["IsDefinedBy.IfcRelDefinesByProperties"],
|
"IfcObject": ["IsDefinedBy.IfcRelDefinesByProperties"],
|
||||||
"IfcElement": ["HasOpenings"],
|
"IfcElement": ["HasOpenings"],
|
||||||
"IfcMaterialDefinition": ["HasExternalReferences", "HasProperties", "HasRepresentation"],
|
self.base_material_class: ["HasExternalReferences", "HasProperties", "HasRepresentation"],
|
||||||
"IfcRepresentationItem": ["StyledByItem"],
|
"IfcRepresentationItem": ["StyledByItem"],
|
||||||
}
|
}
|
||||||
self.existing_contexts = self.file.by_type("IfcGeometricRepresentationContext")
|
self.existing_contexts = self.file.by_type("IfcGeometricRepresentationContext")
|
||||||
|
|||||||
Reference in New Issue
Block a user