mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 01:41:57 +00:00
Feature to create IfcTask trees for entities of IfcWorkSchedule
This commit is contained in:
@@ -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"])
|
||||
Reference in New Issue
Block a user