diff --git a/src/ifcparse/IfcParse.cpp b/src/ifcparse/IfcParse.cpp index 740ae4cc8c..2ff3839b3d 100644 --- a/src/ifcparse/IfcParse.cpp +++ b/src/ifcparse/IfcParse.cpp @@ -812,6 +812,11 @@ IfcEntities Ifc::EntitiesByType(Ifc2x3::Type::Enum t) { MapEntitiesByType::const_iterator it = bytype.find(t); return (it == bytype.end()) ? IfcEntities() : it->second; } +IfcEntities Ifc::EntitiesByType(const std::string& t) { + std::string ty = t; + for (std::string::iterator p = ty.begin(); p != ty.end(); ++p ) *p = toupper(*p); + return EntitiesByType(Ifc2x3::Type::FromString(ty)); +} IfcEntities Ifc::EntitiesByReference(int t) { MapEntitiesByRef::const_iterator it = byref.find(t); return (it == byref.end()) ? IfcEntities() : it->second; diff --git a/src/ifcparse/IfcParse.h b/src/ifcparse/IfcParse.h index d2e45ccf31..6f288e1760 100644 --- a/src/ifcparse/IfcParse.h +++ b/src/ifcparse/IfcParse.h @@ -257,6 +257,10 @@ public: /// NOTE: This also returns subtypes of the requested type, for example: /// IfcWall will also return IfcWallStandardCase entities static IfcEntities EntitiesByType(Ifc2x3::Type::Enum t); + /// Returns all entities in the file that match the positional argument. + /// NOTE: This also returns subtypes of the requested type, for example: + /// IfcWall will also return IfcWallStandardCase entities + static IfcEntities EntitiesByType(const std::string& t); /// Returns all entities in the file that reference the id static IfcEntities EntitiesByReference(int id); /// Returns the entity with the specified id