diff --git a/src/ifcparse/instance_data.h b/src/ifcparse/instance_data.h index a402fa21ec..57d99b7da9 100644 --- a/src/ifcparse/instance_data.h +++ b/src/ifcparse/instance_data.h @@ -494,7 +494,7 @@ class IFC_PARSE_API instance_data { } #ifdef IFOPSH_WITH_ROCKSDB else { - rocks_db_attribute_storage{}.set(get_storage_of_type(), declaration_, identity_, attribute_index, value); + rocks_db_attribute_storage{}.set(get_storage_of_type(), declaration_, declaration_->as_entity() ? id_ : identity_, attribute_index, value); } #endif } @@ -506,7 +506,7 @@ class IFC_PARSE_API instance_data { } #ifdef IFOPSH_WITH_ROCKSDB else { - return rocks_db_attribute_storage{}.has(get_storage_of_type(), declaration_, identity_, attribute_index); + return rocks_db_attribute_storage{}.has(get_storage_of_type(), declaration_, declaration_->as_entity() ? id_ : identity_, attribute_index); } #endif } diff --git a/src/ifcparse/parse.cpp b/src/ifcparse/parse.cpp index 6a6c01701b..566c212865 100644 --- a/src/ifcparse/parse.cpp +++ b/src/ifcparse/parse.cpp @@ -2957,7 +2957,7 @@ attribute_value instance_data::get_attribute_value(size_t index) const return nullptr; } }, file_->storage_); - return attribute_value(storage, identity_, declaration_, (uint8_t) index); + return attribute_value(storage, declaration_->as_entity() ? id_ : identity_, declaration_, (uint8_t)index); } }