Fix latebound enumeration writing in IfcConvert

This commit is contained in:
Thomas Krijnen
2019-06-18 14:28:57 +02:00
parent 12e9f7b941
commit ecb0fee0cd
+3 -3
View File
@@ -1125,14 +1125,14 @@ namespace latebound_access {
auto i = decl->attribute_index(attr); auto i = decl->attribute_index(attr);
auto attr_type = decl->attribute_by_index(i)->type_of_attribute(); auto attr_type = decl->attribute_by_index(i)->type_of_attribute();
if (attr_type->as_named_type() && attr_type->as_named_type()->declared_type()->as_enumeration_type()) { if (attr_type->as_named_type() && attr_type->as_named_type()->declared_type()->as_enumeration_type() && !std::is_same<T, IfcWrite::IfcWriteArgument::EnumerationReference>::value) {
set_enumeration(inst, attr, attr_type->as_named_type()->declared_type()->as_enumeration_type(), t); set_enumeration(inst, attr, attr_type->as_named_type()->declared_type()->as_enumeration_type(), t);
} } else {
IfcWrite::IfcWriteArgument* a = new IfcWrite::IfcWriteArgument; IfcWrite::IfcWriteArgument* a = new IfcWrite::IfcWriteArgument;
a->set(t); a->set(t);
inst->data().attributes()[i] = a; inst->data().attributes()[i] = a;
} }
}
IfcUtil::IfcBaseClass* create(IfcParse::IfcFile& f, const std::string& entity) { IfcUtil::IfcBaseClass* create(IfcParse::IfcFile& f, const std::string& entity) {
auto decl = f.schema()->declaration_by_name(entity); auto decl = f.schema()->declaration_by_name(entity);