几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量  


返回   几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量 » 仿射空间:CAX软件开发(三)二次开发与程序设计 » CAD二次开发 » AutoCAD二次开发 » DirectDWG
用户名
密码
注册 帮助 会员 日历 银行 搜索 今日新帖 标记论坛为已读


回复
 
主题工具 搜索本主题 显示模式
旧 2009-05-04, 03:28 PM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】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
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)
回复


主题工具 搜索本主题
搜索本主题:

高级搜索
显示模式

发帖规则
不可以发表新主题
不可以回复主题
不可以上传附件
不可以编辑您的帖子

vB 代码开启
[IMG]代码开启
HTML代码关闭

相似的主题
主题 主题发起者 论坛 回复 最后发表
【转帖】objectarx&dummies教程(十三)—— deriving from acdbentity yang686526 ObjectARX(C++) 0 2009-04-16 10:40 AM
【转帖】objectarx&dummies习题(一)—— creating and editing entities yang686526 ObjectARX(C++) 0 2009-04-16 10:32 AM
【转帖】dxf格式中entities段中lwpolyline中的组码70代表什么? yang686526 ObjectARX(C++) 0 2009-04-16 09:53 AM
【转帖】convert entities on edge conflicting model references yang686526 SolidWorks二次开发 0 2009-04-13 09:53 AM
【转帖】api to delete all entities on a particular layer yang686526 SolidWorks二次开发 0 2009-04-13 09:00 AM


所有的时间均为北京时间。 现在的时间是 02:33 PM.


于2004年创办,几何尺寸与公差论坛"致力于产品几何量公差标准GD&T | GPS研究/CAD设计/CAM加工/CMM测量"。免责声明:论坛严禁发布色情反动言论及有关违反国家法律法规内容!情节严重者提供其IP,并配合相关部门进行严厉查处,若內容有涉及侵权,请立即联系我们QQ:44671734。注:此论坛须管理员验证方可发帖。
沪ICP备06057009号-2
更多