mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-26 02:07:36 +00:00
temporary fix, we probably should indeed just get rid of that listener
This commit is contained in:
@@ -526,6 +526,16 @@ def ensure_material_assigned(usecase_path: str, ifc_file: ifcopenshell.file, set
|
|||||||
def ensure_material_unassigned(usecase_path: str, ifc_file: ifcopenshell.file, settings: dict[str, Any]) -> None:
|
def ensure_material_unassigned(usecase_path: str, ifc_file: ifcopenshell.file, settings: dict[str, Any]) -> None:
|
||||||
elements = settings["products"]
|
elements = settings["products"]
|
||||||
|
|
||||||
|
# unassign_material could be called when product is about to get removed
|
||||||
|
# and representation might be already removed.
|
||||||
|
elements = [
|
||||||
|
e
|
||||||
|
for e in elements
|
||||||
|
if (obj := tool.Ifc.get_object(e))
|
||||||
|
and obj.data
|
||||||
|
and tool.Ifc.get_entity_by_id(obj.data.BIMMeshProperties.ifc_definition_id)
|
||||||
|
]
|
||||||
|
|
||||||
for element in elements[:]:
|
for element in elements[:]:
|
||||||
if element.is_a("IfcElementType"):
|
if element.is_a("IfcElementType"):
|
||||||
elements.extend(tool.Model.get_occurrences_without_material_override(element))
|
elements.extend(tool.Model.get_occurrences_without_material_override(element))
|
||||||
|
|||||||
Reference in New Issue
Block a user