mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 09:48:32 +00:00
Support other voiding IfcFeatureElementSubtraction elements #3889
Support other voiding IfcFeatureElementSubtraction besides IfcOpeningElement.
This commit is contained in:
@@ -130,7 +130,7 @@ class Usecase:
|
||||
elif inverse.is_a("IfcRelVoidsElement") and inverse.RelatingBuildingElement == from_element:
|
||||
opening = inverse.RelatedOpeningElement
|
||||
# We don't copy filled openings, since there is no guarantee the filling is also copied
|
||||
if not opening.HasFillings:
|
||||
if not opening.is_a("IfcOpeningElement") or not opening.HasFillings:
|
||||
new_opening = ifcopenshell.api.run("root.copy_class", self.file, product=opening)
|
||||
new_opening.VoidsElements[0].RelatingBuildingElement = to_element
|
||||
if new_opening.ObjectPlacement and new_opening.ObjectPlacement.is_a("IfcLocalPlacement"):
|
||||
|
||||
@@ -50,6 +50,7 @@ class Usecase:
|
||||
def execute(self):
|
||||
for rel in self.settings["opening"].VoidsElements:
|
||||
self.file.remove(rel)
|
||||
for rel in self.settings["opening"].HasFillings:
|
||||
self.file.remove(rel)
|
||||
if self.settings["opening"].is_a("IfcOpeningElement"):
|
||||
for rel in self.settings["opening"].HasFillings:
|
||||
self.file.remove(rel)
|
||||
ifcopenshell.api.run("root.remove_product", self.file, product=self.settings["opening"])
|
||||
|
||||
Reference in New Issue
Block a user