mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-16 21:42:19 +00:00
Fix #275
This commit is contained in:
@@ -1726,12 +1726,13 @@ void IfcFile::removeEntity(IfcUtil::IfcBaseClass* entity) {
|
|||||||
for (IfcEntityList::it it = entity_attributes->begin(); it != entity_attributes->end(); ++it) {
|
for (IfcEntityList::it it = entity_attributes->begin(); it != entity_attributes->end(); ++it) {
|
||||||
IfcUtil::IfcBaseClass* entity_attribute = *it;
|
IfcUtil::IfcBaseClass* entity_attribute = *it;
|
||||||
if (entity_attribute == entity) continue;
|
if (entity_attribute == entity) continue;
|
||||||
if (entity_attribute->entity->id() != 0) {
|
const unsigned int name = entity_attribute->entity->id();
|
||||||
// Do not update inverses for simple types.
|
// Do not update inverses for simple types (which have id()==0 in IfcOpenShell).
|
||||||
const IfcEntityList::ptr attribute_inverses = entitiesByReference(entity_attribute->entity->id());
|
if (name != 0) {
|
||||||
|
entities_by_ref_t::iterator it = byref.find(name);
|
||||||
if (attribute_inverses) {
|
if (it != byref.end()) {
|
||||||
attribute_inverses->remove(entity);
|
std::vector<unsigned>& ids = it->second;
|
||||||
|
std::remove(ids.begin(), ids.end(), name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user