mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-17 22:11:36 +00:00
SvgSerializer: Name storeys properly too
- Fix correct "storey-" prefix for stories - Follow user settings on names/guids/notset
This commit is contained in:
committed by
Thomas Krijnen
parent
3071caf4b1
commit
2dbc3b43c6
@@ -348,7 +348,11 @@ std::string SvgSerializer::nameElement(const IfcSchema::IfcProduct* elem) {
|
|||||||
if (elem == 0) { return ""; }
|
if (elem == 0) { return ""; }
|
||||||
std::ostringstream oss;
|
std::ostringstream oss;
|
||||||
const std::string type = elem->is(IfcSchema::Type::IfcBuildingStorey) ? "storey" : "product";
|
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();
|
return oss.str();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user