mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-11 02:02:22 +00:00
#2697 take only a single inverse at a time
This commit is contained in:
@@ -76,7 +76,11 @@ class Usecase:
|
||||
ifcopenshell.api.run("grid.remove_grid_axis", self.file, axis=axis)
|
||||
|
||||
# TODO: remove object placement and other relationships
|
||||
for inverse in self.file.get_inverse(self.settings["product"]):
|
||||
|
||||
# Use a while loop so that we don't keep inverses in memory that might
|
||||
# get deleted as a result of the API calls in the loop body (#2697)
|
||||
while inverses := self.file.get_inverse(self.settings["product"]):
|
||||
inverse = next(iter(inverses))
|
||||
if inverse.is_a("IfcRelDefinesByProperties"):
|
||||
ifcopenshell.api.run(
|
||||
"pset.remove_pset",
|
||||
|
||||
Reference in New Issue
Block a user