@pieter_souvereyns wrote:
...
I loop now trough all the elements but when you have to do it for 7 tables. It becomes slow let's say the time is significant.
I am with you regarding the slowness for searching through entities for ObjectData. Worse, it seems that even the Map Object API has been the same for last 15+ years with very little update, if any, the speed of looping entities for accessing ObjectData changes from version to version of Acad Map and the changes were mostly became worse in a version and only got back in next version or two, but never got noticeable faster.
It has been quite common practice at my work where I need to search entities according to OD attached to them. The slowness is quite frustration if the entity count is large.
Yes, Map's query API only works on attached drawing set, not current drawing, just the same as doing Map query manually. A possible workaround, which I have never used but technically doable manually or programmatically, is to create a copy of the current drawing, rename it a temporary name, then attach it into DrawingSet and execute the query. You can place the query result in a temporary layer... However, depending on the purpose of getting entities based on ObjectData, this workaround may or may apply to your business requirement, of course. Just like at my work, I have to loop through entities mostly and take the hit of slowness; and lucky me that I have not had to dealt with drawings with large/huge number of entities with OD in this manner.