Find or loop Map object data

Find or loop Map object data

pieter_souvereyns
Enthusiast Enthusiast
773 Views
3 Replies
Message 1 of 4

Find or loop Map object data

pieter_souvereyns
Enthusiast
Enthusiast

It look's to me that there is no way to query the objects that have objectdata (OD).
That you have to loop trough all object and look if they have objectdata.
Is this correct or do I miss something?
A dxfcode or a method like PropertyDataServices.GetAllPropertySetsUsingDefinition for propertiesets?
Thanks
Pieter

0 Likes
Accepted solutions (1)
774 Views
3 Replies
Replies (3)
Message 2 of 4

norman.yuan
Mentor
Mentor

Firstly, your question is specific to Map 3D/C3D, so posting in Map3D/C3D forums may give you better chance of getting more pointed help.

 

You can do entity queries, as you manually do in Map3d, by using APIs in Autodesk.Gis.Map.Query namespace, instead of looping through entities to examine attached object data.

 

"PropertyDataServices", as you mentioned, is only available in C3D, not in pure Map3D and has nothing to do with ObjectData. so if you want to build Map3D query with Autodesk.Gis.Map.Query namespace API, even you use C3D, PropertyDataSet/Services would not help in terms of ObjectData.

 

 

Norman Yuan

Drive CAD With Code

EESignature

0 Likes
Message 3 of 4

pieter_souvereyns
Enthusiast
Enthusiast

Indeed I saw after I posted this one question, that there is also a map develepment forum. So I have make the question there also but no luck at the moment.
I refer indeed to propertysets that is very different I know, but it was as reference.
Autodesk.Gis.Map.Query is this also usable for query's in the same drawing? I don't find much information about this only for map 2009 an then it was not possible to query in the drawing (only attached drawings).
Can you point me to some reading for this query or an example maybe? Query all the objects inside the current drawing with object data table name "XX".
It would be appeciated.
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.

0 Likes
Message 4 of 4

norman.yuan
Mentor
Mentor
Accepted solution

@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.

Norman Yuan

Drive CAD With Code

EESignature

0 Likes