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

几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量 (http://www.dimcax.com/hust/index.php)
-   DirectDWG (http://www.dimcax.com/hust/forumdisplay.php?f=89)
-   -   【转帖】adding custom objects to a custom dictionary (http://www.dimcax.com/hust/showthread.php?t=15050)

yang686526 2009-05-04 03:43 PM

【转帖】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(..).


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