Feature to create IfcTask trees for entities of IfcWorkSchedule

This commit is contained in:
bosonprojets
2021-04-18 00:49:43 +00:00
parent f5d27621e7
commit 3201c234fa
8 changed files with 196 additions and 96 deletions
@@ -0,0 +1,19 @@
import ifcopenshell.api
class Usecase:
def __init__(self, file, **settings):
self.file = file
self.settings = {"task": None}
for key, value in settings.items():
self.settings[key] = value
def execute(self):
# TODO: do a deep purge
ifcopenshell.api.run(
"project.unassign_declaration",
self.file,
definition=self.settings["task"],
relating_context=self.file.by_type("IfcContext")[0],
)
self.file.remove(self.settings["task"])