Serialization of header entities with #0=

This commit is contained in:
Thomas Krijnen
2025-08-28 11:15:18 +02:00
parent b6712602e2
commit 3245d0af5c
+2 -2
View File
@@ -976,7 +976,7 @@ namespace {
data_ << "." << i.value() << ".";
}
void operator()(const IfcUtil::IfcBaseClass* const& i) {
if (i->declaration().as_entity() == nullptr) {
if (i->declaration().as_entity() == nullptr || i->declaration().schema() == &Header_section_schema::get_schema()) {
i->toString(data_, upper_);
} else {
data_ << "#" << i->id();
@@ -2714,7 +2714,7 @@ AttributeValue IfcUtil::IfcBaseClass::get_attribute_value(size_t index) const {
void IfcUtil::IfcBaseClass::toString(std::ostream& out, bool upper) const
{
const auto *ent = declaration().as_entity();
if (ent != nullptr) {
if (ent != nullptr && declaration().schema() != &Header_section_schema::get_schema()) {
out << "#" << as<IfcUtil::IfcBaseEntity>()->id() << "=";
}
if (upper) {