From 764b880ea8c56db1f45880e05d8acac21c445c83 Mon Sep 17 00:00:00 2001 From: bosonprojets Date: Thu, 6 May 2021 06:19:40 +0000 Subject: [PATCH] Fix MSProject relationship_id issue at import --- src/ifcp6/ifcp6/msp2ifc.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/ifcp6/ifcp6/msp2ifc.py b/src/ifcp6/ifcp6/msp2ifc.py index 40af542b31..1f8d86e2e6 100644 --- a/src/ifcp6/ifcp6/msp2ifc.py +++ b/src/ifcp6/ifcp6/msp2ifc.py @@ -45,12 +45,14 @@ class MSP2Ifc: def parse_relationship_xml(self, task): relationships = {} + id = 0 if task.findall("pr:PredecessorLink", self.ns): for relationship in task.findall("pr:PredecessorLink", self.ns): - relationships[task.find("pr:UID", self.ns).text] = { + relationships[id] = { "PredecessorTask": relationship.find("pr:PredecessorUID", self.ns).text, "Type": relationship.find("pr:Type", self.ns).text } + id += 1 return relationships def parse_task_xml(self, project): @@ -59,11 +61,6 @@ class MSP2Ifc: task_index_level = task.find("pr:OutlineLevel", self.ns).text wbs_id = task.find("pr:WBS", self.ns).text relationships = self.parse_relationship_xml(task) - - # for relationship in task.findall("pr:PredecessorLink", self.ns): - # predecessor_task = relationship.find("pr:PredecessorUID", self.ns).text - # type = relationship.find("pr:Type", self.ns).text - outline_level = int(task.find("pr:OutlineLevel", self.ns).text) if outline_level != 0: