From 3b81c158f340f71a7038d52dfdd9d68a8e5225af Mon Sep 17 00:00:00 2001 From: garylzimmer Date: Fri, 7 Oct 2022 05:36:25 -0400 Subject: [PATCH] Added auto renaming for null project name (#2478) Sorry it took me almost a year to implement @aothms excellent suggestion! https://github.com/IfcOpenShell/IfcOpenShell/issues/1954#issuecomment-1002463624 --- src/ifc4d/ifc4d/p62ifc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ifc4d/ifc4d/p62ifc.py b/src/ifc4d/ifc4d/p62ifc.py index 843af05867..aeb4338c07 100644 --- a/src/ifc4d/ifc4d/p62ifc.py +++ b/src/ifc4d/ifc4d/p62ifc.py @@ -91,7 +91,7 @@ class P62Ifc: root = tree.getroot() self.ns = {"pr": root.tag[1:].partition("}")[0]} project = root.find("pr:Project", self.ns) - self.project["Name"] = project.find("pr:Name", self.ns).text + self.project["Name"] = project.findtext("pr:Name") or "Unnamed" self.parse_calendar_xml(root) self.parse_calendar_xml(project) self.parse_wbs_xml(project)