New Feature to add Tasks and Task Relationships in the python ifcopenshell API (#1432)

This commit is contained in:
Sigma Dimensions
2021-04-14 23:40:29 +00:00
committed by GitHub
parent d11b91f152
commit 5dec636584
3 changed files with 70 additions and 0 deletions
@@ -0,0 +1,20 @@
import ifcopenshell.api
class Usecase:
def __init__(self, file, **settings):
self.file = file
self.settings = {"name": None, "predefined_type": "NOTDEFINED", "is_milestone":False, "identification": "none", "predecessor_to":None, "successor_from":None}
for key, value in settings.items():
self.settings[key] = value
def execute(self):
task = ifcopenshell.api.run(
"root.create_entity",
self.file,
ifc_class="IfcTask",
predefined_type=self.settings["predefined_type"],
name=self.settings["name"],
)
task.IsMilestone = self.settings["is_milestone"]
return task