From 17bb42faaba6f008dc62fbe0c7f896746e9b7df5 Mon Sep 17 00:00:00 2001 From: johltn Date: Thu, 18 Feb 2021 11:19:03 +0100 Subject: [PATCH] Add IFC entity type as element group attribute --- src/serializers/HdfSerializer.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/serializers/HdfSerializer.cpp b/src/serializers/HdfSerializer.cpp index b3f30366e0..b1d4b84ea1 100644 --- a/src/serializers/HdfSerializer.cpp +++ b/src/serializers/HdfSerializer.cpp @@ -113,12 +113,18 @@ void HdfSerializer::write(const IfcGeom::TriangulationElement* o) { const int fcount = (int)mesh.faces().size() / 3; const bool isyup = settings().get(SerializerSettings::USE_Y_UP); + std::string value = o->type(); if (fcount > 0) { guids.insert(guid); elementGroup = file.createGroup(guid); meshGroup = elementGroup.createGroup("Triangle Mesh"); + H5::StrType str_type(0, H5T_VARIABLE); + H5:: DataSpace attrdspace(H5S_SCALAR); + H5::Attribute att = elementGroup.createAttribute("IFC entity type", str_type, attrdspace); + att.write(str_type, value); + const int RANK = 2; hsize_t dimsf[2];