diff --git a/src/ifcgeom/IfcGeomRepresentation.cpp b/src/ifcgeom/IfcGeomRepresentation.cpp index 1c6e31813a..54ec30ea7f 100644 --- a/src/ifcgeom/IfcGeomRepresentation.cpp +++ b/src/ifcgeom/IfcGeomRepresentation.cpp @@ -423,3 +423,11 @@ const IfcGeom::ConversionResultShape* IfcGeom::Representation::BRep::item(int i) return nullptr; } } + +int IfcGeom::Representation::BRep::item_id(int i) const { + if (i >= 0 && i < shapes_.size()) { + return shapes_[i].ItemId(); + } else { + return 0; + } +} diff --git a/src/ifcgeom/IfcGeomRepresentation.h b/src/ifcgeom/IfcGeomRepresentation.h index d071cfcce7..5cfd3d0bc2 100644 --- a/src/ifcgeom/IfcGeomRepresentation.h +++ b/src/ifcgeom/IfcGeomRepresentation.h @@ -72,6 +72,7 @@ namespace IfcGeom { int size() const { return shapes_.size(); } const IfcGeom::ConversionResultShape* item(int i) const; + int item_id(int i) const; }; class IFC_GEOM_API Serialization : public Representation {