From 788a5a829e7a610c9223fc3275ac276e4244fddc Mon Sep 17 00:00:00 2001 From: Dion Moult Date: Wed, 23 Jun 2021 14:13:18 +1000 Subject: [PATCH] Tasks now auto generate identification numbers --- .../ifcopenshell/api/sequence/add_task.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/ifcopenshell-python/ifcopenshell/api/sequence/add_task.py b/src/ifcopenshell-python/ifcopenshell/api/sequence/add_task.py index 98ce8bc33a..0551fe52f5 100644 --- a/src/ifcopenshell-python/ifcopenshell/api/sequence/add_task.py +++ b/src/ifcopenshell-python/ifcopenshell/api/sequence/add_task.py @@ -19,7 +19,6 @@ class Usecase: ifc_class="IfcTask", name=None, predefined_type="NOTDEFINED", - identification="none", ) task.IsMilestone = False if self.settings["work_schedule"]: @@ -33,7 +32,9 @@ class Usecase: } ) elif self.settings["parent_task"]: - ifcopenshell.api.run( + rel = ifcopenshell.api.run( "nest.assign_object", self.file, related_object=task, relating_object=self.settings["parent_task"] ) + if self.settings["parent_task"].Identification: + task.Identification = self.settings["parent_task"].Identification + "." + str(len(rel.RelatedObjects)) return task