mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-18 22:33:33 +00:00
Don't fail on parse errors while resolving inverse attributes
This commit is contained in:
@@ -1896,15 +1896,20 @@ IfcEntityList::ptr IfcFile::getInverse(int instance_id, IfcSchema::Type::Enum ty
|
|||||||
for(IfcEntityList::it it = all->begin(); it != all->end(); ++it) {
|
for(IfcEntityList::it it = all->begin(); it != all->end(); ++it) {
|
||||||
bool valid = type == IfcSchema::Type::UNDEFINED || (*it)->is(type);
|
bool valid = type == IfcSchema::Type::UNDEFINED || (*it)->is(type);
|
||||||
if (valid && attribute_index >= 0) {
|
if (valid && attribute_index >= 0) {
|
||||||
Argument* arg = (*it)->entity->getArgument(attribute_index);
|
try {
|
||||||
if (arg->type() == IfcUtil::Argument_ENTITY_INSTANCE) {
|
Argument* arg = (*it)->entity->getArgument(attribute_index);
|
||||||
valid = instance == *arg;
|
if (arg->type() == IfcUtil::Argument_ENTITY_INSTANCE) {
|
||||||
} else if (arg->type() == IfcUtil::Argument_AGGREGATE_OF_ENTITY_INSTANCE) {
|
valid = instance == *arg;
|
||||||
IfcEntityList::ptr li = *arg;
|
} else if (arg->type() == IfcUtil::Argument_AGGREGATE_OF_ENTITY_INSTANCE) {
|
||||||
valid = li->contains(instance);
|
IfcEntityList::ptr li = *arg;
|
||||||
} else if (arg->type() == IfcUtil::Argument_AGGREGATE_OF_AGGREGATE_OF_ENTITY_INSTANCE) {
|
valid = li->contains(instance);
|
||||||
IfcEntityListList::ptr li = *arg;
|
} else if (arg->type() == IfcUtil::Argument_AGGREGATE_OF_AGGREGATE_OF_ENTITY_INSTANCE) {
|
||||||
valid = li->contains(instance);
|
IfcEntityListList::ptr li = *arg;
|
||||||
|
valid = li->contains(instance);
|
||||||
|
}
|
||||||
|
} catch (IfcException& e) {
|
||||||
|
valid = false;
|
||||||
|
Logger::Error(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (valid) {
|
if (valid) {
|
||||||
|
|||||||
Reference in New Issue
Block a user