查看单个帖子
旧 2009-05-04, 03:43 PM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】adding custom objects to a custom dictionary

adding custom objects to a custom dictionary
adding custom objects to a custom dictionary
hi,
i am working with custom dictionaries and objects. the custom dictionary is added to the namedobjectdictionary, and it contains custom objects.
adding a custom object to the custom dictionary seems to be no problem:
oddbobjectid odtempid = pmydictionary->setat( "name", pmyobject );
even odtempid looks good.
however, when it comes to write out the data to a (dxf) file, then only the data of the dictionary is written - the function dxfoutfields(...) of my custom object is not called.
if i add my custom object to a normal dictionary, then the dxfoutfields(..) function is called, and the object is written to the objects section.
do i have to derive a function for the custom dictionary so that the custom entity is added to the database?
torsten
p.s.: after some testing it looks to me that my custom dictionary needs some functions to read and write the entities/objects that have been added to it. i tried to read write the entities during the dxfoutfields(...) and dxfinfields(...) functions of the dictionary, but it didn't work. does anybody has an idea what to do?
finally i found the errors:
1. to get my custom dictionary read, i need the follwing code in dwginfields(..)
oddbdictionary::dwginfields(pfiler);
2. only when iterating thru this dictionary, the included custom objects were read via dwginfields(..).
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)