diff --git a/src/ifcwrap/IfcGeomWrapper.i b/src/ifcwrap/IfcGeomWrapper.i index 4f18ee14c7..0f26e28db7 100644 --- a/src/ifcwrap/IfcGeomWrapper.i +++ b/src/ifcwrap/IfcGeomWrapper.i @@ -151,7 +151,14 @@ std::pair vector_to_buffer(const T& t) { std::string taxonomy_item_repr(ifcopenshell::geometry::taxonomy::item::ptr i) { std::ostringstream oss; i->print(oss); - return oss.str(); + std::string result = oss.str(); + + // Strip new line at the end of the printed result. + // result is probably always ends with \n but just to be safe. + if (!result.empty() && result.back() == '\n') { + result.pop_back(); + } + return result; } %}