mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-11 02:02:22 +00:00
18 lines
515 B
Python
18 lines
515 B
Python
|
|
import ifcopenshell
|
||
|
|
|
||
|
|
|
||
|
|
class Usecase:
|
||
|
|
def __init__(self, file, settings=None):
|
||
|
|
self.file = file
|
||
|
|
self.settings = {
|
||
|
|
"product": None,
|
||
|
|
"document": None,
|
||
|
|
}
|
||
|
|
for key, value in settings.items():
|
||
|
|
self.settings[key] = value
|
||
|
|
|
||
|
|
def execute(self):
|
||
|
|
for rel in self.settings["product"].HasAssociations:
|
||
|
|
if rel.is_a("IfcRelAssociatesDocument") and rel.RelatingDocument == self.settings["document"]:
|
||
|
|
self.file.remove(rel)
|