diff --git a/src/ifcgeomserver/IfcGeomServer.cpp b/src/ifcgeomserver/IfcGeomServer.cpp index 03850784ce..e15d888f2b 100644 --- a/src/ifcgeomserver/IfcGeomServer.cpp +++ b/src/ifcgeomserver/IfcGeomServer.cpp @@ -240,7 +240,12 @@ protected: 0, 0, 0, 1 }; swrite(s, std::string((char*)matrix_array, 16 * sizeof(float))); - swrite(s, geom->geometry().id()); + + // The first bit of the string is always the instance name of the representation. + const std::string& representation_id = geom->geometry().id(); + const int integer_representation_id = atoi(representation_id.c_str()); + swrite(s, (int32_t)integer_representation_id); + swrite(s, std::string((char*)geom->geometry().verts().data(), geom->geometry().verts().size() * sizeof(float))); swrite(s, std::string((char*)geom->geometry().normals().data(), geom->geometry().normals().size() * sizeof(float))); { diff --git a/src/ifcwrap/IfcGeomWrapper.i b/src/ifcwrap/IfcGeomWrapper.i index f6870770ae..01fbc575ac 100644 --- a/src/ifcwrap/IfcGeomWrapper.i +++ b/src/ifcwrap/IfcGeomWrapper.i @@ -374,7 +374,7 @@ struct ShapeRTTI : public boost::static_visitor IfcGeom::IfcRepresentationShapeItems shapes; if (kernel.convert_shapes(instance, shapes)) { IfcGeom::ElementSettings element_settings(settings, kernel.getValue(IfcGeom::Kernel::GV_LENGTH_UNIT), IfcSchema::Type::ToString(instance->type())); - IfcGeom::Representation::BRep brep(element_settings, instance->entity->id(), shapes); + IfcGeom::Representation::BRep brep(element_settings, boost::lexical_cast(instance->entity->id()), shapes); try { if (settings.get(IfcGeom::IteratorSettings::USE_BREP_DATA)) { return new IfcGeom::Representation::Serialization(brep);