From 8dbeb928e3cd4cc520c9858d2dffd82a15c6f990 Mon Sep 17 00:00:00 2001 From: "Sigma Dimensions (Yass)" <79010126+myoualid@users.noreply.github.com> Date: Wed, 13 Mar 2024 03:15:27 +0000 Subject: [PATCH] fix construction schedule import without IfcProject #4412 --- src/ifc4d/ifc4d/csv4d2ifc.py | 1 + src/ifc4d/ifc4d/msp2ifc.py | 1 + src/ifc5d/ifc5d/csv2ifc.py | 1 + 3 files changed, 3 insertions(+) diff --git a/src/ifc4d/ifc4d/csv4d2ifc.py b/src/ifc4d/ifc4d/csv4d2ifc.py index a5f6a460a9..4da00339c6 100644 --- a/src/ifc4d/ifc4d/csv4d2ifc.py +++ b/src/ifc4d/ifc4d/csv4d2ifc.py @@ -118,6 +118,7 @@ class Csv2Ifc: def create_boilerplate_ifc(self): self.file = ifcopenshell.file(schema="IFC4") + ifcopenshell.api.run("root.create_entity", self.file, ifc_class="IfcProject") self.work_plan = self.file.create_entity("IfcWorkPlan") def create_tasks(self, tasks, parent=None): diff --git a/src/ifc4d/ifc4d/msp2ifc.py b/src/ifc4d/ifc4d/msp2ifc.py index 159d8279e9..1b02aa53b9 100644 --- a/src/ifc4d/ifc4d/msp2ifc.py +++ b/src/ifc4d/ifc4d/msp2ifc.py @@ -194,6 +194,7 @@ class MSP2Ifc: def create_boilerplate_ifc(self): self.file = ifcopenshell.file(schema="IFC4") + ifcopenshell.api.run("root.create_entity", self.file, ifc_class="IfcProject") self.work_plan = self.file.create_entity("IfcWorkPlan") def create_tasks(self, work_schedule): diff --git a/src/ifc5d/ifc5d/csv2ifc.py b/src/ifc5d/ifc5d/csv2ifc.py index cb7b8869ff..1e708d1e8f 100644 --- a/src/ifc5d/ifc5d/csv2ifc.py +++ b/src/ifc5d/ifc5d/csv2ifc.py @@ -196,6 +196,7 @@ class Csv2Ifc: def create_boilerplate_ifc(self): self.file = ifcopenshell.file(schema="IFC4") + ifcopenshell.api.run("root.create_entity", self.file, ifc_class="IfcProject") def has_property(self, product, property_name):