![]() |
【转帖】access objectdatarecords associated with entities
access objectdatarecords associated with entities
access objectdatarecords associated with entities hi, i am trying to access objectdata records that i associated with some entities in acadmap. my problem is that i cannot get access to the objectdata table definition and to the objectdata itself. i know the name of my objectdata table and i know exactly which entity has the objectdata records associated with them. my goal is to make sure i access the right objectdata record linked to the objectdata table i want. i am using ddx 1.05. 1 - is this possible with ddx ? 2 - is this possible with another opendwg dll ? 3 - can i have some code sample to get to the objectdata table & objectdata records ? as i understand you are talking about extended data. it can be assigned to any entity in drawing. to set/access this data you should call setxdata/getxdata methods dim xdatatype as variant dim xdata as variant dim ent as iacadentity for each ent in block ' retrieve the appname xdata type and value ent.getxdata "my_app", xdatatype, xdata next to access the registred application table you can use iacadregisteredapplications interface dim regapps as iacadregisteredapplications dim rapp as iacadregisteredapplication set regapps = odatabase.registeredapplications ncount = regapps.count for ni = 1 to ncount set rapp = regapp.item(ni - 1) print rapp.name next ni actually i really refer to object data records which are different from the extended data records. in order to access objectdata using objectarx in acad you must link other dll's that are specific to acadmap. from the list of dictionaries in the drawings i have there is 1 proxyobject which might be the object data table that i am refering to but there is no way to know since it cannot be accessed with ddx. could it be possible to use the loadarx method to load the arx specific to acadmap that are required to use objectdata ? you are talking not about extended data nor xrecords. your object being loaded from dwg file into autocad without specific arx appears as proxy object and to access its data in autocad you need specific arx dll. correct? autocad's arx dll cannot be loaded into dwgdirect. but similar effect can be achieved by writing your custom object implementation inside dwgdirect (in c++). without it unknown custom data can't be accessed. sergey slezkin is there some documentation on how to create custom objects in c++ ? or by using the loadarx function of ddx i could create a custom arx that will access the data then send it through temp files on disk and i could just read the file from my .net application. sounds like a crappy solution but it might be faster than creating some custom c++ objects around dwgdirect. example of defining custom object presents in odamfcapp sample (examplecustobject.h & examplecustobject.cpp) correct method of handling custom objects is creating a dll which ddx will load. (the same dll can contain activex interface wrappers to enable you access the data without temporary files). but currently loadarx method is not implemented in ddx. sergey slezkin |
所有的时间均为北京时间。 现在的时间是 07:59 AM. |