mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 09:21:46 +00:00
New Feature to add Tasks and Task Relationships in the python ifcopenshell API (#1432)
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user