mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-16 13:46:54 +00:00
Disallow adding instances from different schema
This commit is contained in:
@@ -1511,6 +1511,10 @@ void IfcFile::addEntities(IfcEntityList::ptr es) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
IfcUtil::IfcBaseClass* IfcFile::addEntity(IfcUtil::IfcBaseClass* entity) {
|
IfcUtil::IfcBaseClass* IfcFile::addEntity(IfcUtil::IfcBaseClass* entity) {
|
||||||
|
if (entity->declaration().schema() != schema()) {
|
||||||
|
throw IfcParse::IfcException("Unabled to add instance from " + entity->declaration().schema()->name() + " schema to file with " + schema()->name() + " schema");
|
||||||
|
}
|
||||||
|
|
||||||
// If this instance has been inserted before, return
|
// If this instance has been inserted before, return
|
||||||
// a reference to the copy that was created from it.
|
// a reference to the copy that was created from it.
|
||||||
entity_entity_map_t::iterator mit = entity_file_map.find(entity);
|
entity_entity_map_t::iterator mit = entity_file_map.find(entity);
|
||||||
|
|||||||
Reference in New Issue
Block a user