mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 01:41:57 +00:00
resource.remove_resource - fix issue removing resources in ifc2x3
This commit is contained in:
@@ -74,8 +74,9 @@ def remove_resource(file: ifcopenshell.file, resource: ifcopenshell.entity_insta
|
||||
file.remove(inverse)
|
||||
if history:
|
||||
ifcopenshell.util.element.remove_deep2(file, history)
|
||||
if settings["resource"].Usage:
|
||||
file.remove(settings["resource"].Usage)
|
||||
# Usage was added in IFC4.
|
||||
if usage := getattr(settings["resource"], "Usage", None):
|
||||
file.remove(usage)
|
||||
if settings["resource"].BaseQuantity:
|
||||
ifcopenshell.api.run(
|
||||
"resource.remove_resource_quantity",
|
||||
|
||||
Reference in New Issue
Block a user