Thanks thomthom. I could’nt find any example in the SDK package which does similar operation. But I figured out why I was getting the error. In the second line I didn’t assign LOEntityListRef entity_list as SU_INVALID.
size_t num_entities = 0;
LOEntityListRef entity_list = SU_INVALID;
res = LOEntityListCreate(&entity_list);
std::cout << "Result - LOEntityListCreate : " << res << std::endl;
res = LODocumentGetSharedEntities(document_ref,entity_list);
std::cout << "Result - LODocumentGetSharedEntities : " << res << std::endl;
res = LOEntityListGetNumberOfEntities(entity_list,&num_entities);
std::cout << "Result - LOEntityListGetNumberOfEntities : " << res << std::endl;
For the above snippet I am getting the output
Result - LOEntityListCreate : 0
Result - LODocumentGetSharedEntities : 9
Result - LOEntityListGetNumberOfEntities : 0
Not sure why the second line is showing the output 9. That means SU_ERROR_NO_DATA. My layout document contains 4 layers which includes some texts in the title block and the exported skp model.
I need to modify the texts in the title block. And I assumed I can achieve it by looping through all the entities, finding the text and replacing it.