From 1a2d0d702b8b60b8d654ab7e2e24d9f1cd7821e4 Mon Sep 17 00:00:00 2001 From: Thomas Krijnen Date: Thu, 22 Jul 2021 11:47:47 +0200 Subject: [PATCH] #1579 Update templates, thanks @RickBrice --- src/ifcopenshell-python/ifcopenshell/express/templates.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/ifcopenshell-python/ifcopenshell/express/templates.py b/src/ifcopenshell-python/ifcopenshell/express/templates.py index 4341c7957b..ef74b7bc9e 100644 --- a/src/ifcopenshell-python/ifcopenshell/express/templates.py +++ b/src/ifcopenshell-python/ifcopenshell/express/templates.py @@ -176,12 +176,14 @@ const IfcParse::enumeration_type& %(schema_name)s::%(name)s::Class() { return *% } %(schema_name)s::%(name)s::%(name)s(Value v) { + data_ = new IfcEntityInstanceData(%(schema_name_upper)s_%(name)s_type); IfcWrite::IfcWriteArgument* attr = new IfcWrite::IfcWriteArgument(); attr->set(IfcWrite::IfcWriteArgument::EnumerationReference(v,ToString(v))); data_->setArgument(0,attr); } %(schema_name)s::%(name)s::%(name)s(const std::string& v) { + data_ = new IfcEntityInstanceData(%(schema_name_upper)s_%(name)s_type); IfcWrite::IfcWriteArgument* attr = new IfcWrite::IfcWriteArgument(); attr->set(IfcWrite::IfcWriteArgument::EnumerationReference(FromString(v),ToString(FromString(v)))); data_->setArgument(0,attr);