From 1ea4f50d30097da2e4a9404c89bf971ab42ff7f7 Mon Sep 17 00:00:00 2001 From: ArturTomczak Date: Fri, 9 Jul 2021 08:35:04 +0200 Subject: [PATCH] fix facet constructors --- src/ifcopenshell-python/ifcopenshell/ids.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/ifcopenshell-python/ifcopenshell/ids.py b/src/ifcopenshell-python/ifcopenshell/ids.py index cc26d06ff7..4b0f9f762c 100644 --- a/src/ifcopenshell-python/ifcopenshell/ids.py +++ b/src/ifcopenshell-python/ifcopenshell/ids.py @@ -95,6 +95,7 @@ class entity(facet): parameters = ["name", "predefinedtype"] def create(name=None, predefinedtype=None): + inst = entity() inst.name = name inst.predefinedtype = predefinedtype return inst @@ -130,6 +131,7 @@ class classification(facet): message = "%(location)sclassification reference %(value)s from '%(system)s'" def create(location='any', value=None, system=None): + inst = classification() inst.location = location inst.value = value inst.system = system @@ -267,6 +269,7 @@ class material(facet): message = "%(location)smaterial '%(value)s'" def create(location='any', value=None): + inst = material() inst.location = location inst.value = value # self.attributes = {'@location': location} # 'type', 'instance', 'any' @@ -580,6 +583,7 @@ class ids: f.write('\n') f.write('\n') f.write(ids_str) + f.close() ids_schema.validate(fn) return ids_schema.is_valid(fn)