From a9606b30447564d9f0f65b2b62ab8a479aa4ccdc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anders=20Granskogen=20Bj=C3=B8rnstad?= Date: Wed, 8 Nov 2017 16:40:17 +0100 Subject: [PATCH] SvgSerializer: Name storeys properly too - Fix correct "storey-" prefix for stories - Follow user settings on names/guids/notset --- src/ifcconvert/SvgSerializer.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/ifcconvert/SvgSerializer.cpp b/src/ifcconvert/SvgSerializer.cpp index 7de86250c7..e346e772f4 100644 --- a/src/ifcconvert/SvgSerializer.cpp +++ b/src/ifcconvert/SvgSerializer.cpp @@ -348,7 +348,11 @@ std::string SvgSerializer::nameElement(const IfcSchema::IfcProduct* elem) { if (elem == 0) { return ""; } std::ostringstream oss; const std::string type = elem->is(IfcSchema::Type::IfcBuildingStorey) ? "storey" : "product"; - oss << "id=\"product-" << IfcParse::IfcGlobalId(elem->GlobalId()).formatted() << "\""; + const std::string name = (settings().get(SerializerSettings::USE_ELEMENT_GUIDS) + ? elem->GlobalId() : (settings().get(SerializerSettings::USE_ELEMENT_NAMES) + ? elem->Name() : IfcParse::IfcGlobalId(elem->GlobalId()).formatted())); + + oss << "id=\"" << type << "-" << name << "\""; return oss.str(); }