几何尺寸与公差论坛------致力于产品几何量公差标准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)
-   -   【转帖】how can i read proxy data (http://www.dimcax.com/hust/showthread.php?t=16551)

yang686526 2009-05-05 12:18 PM

【转帖】how can i read proxy data
 
how can i read proxy data?
how can i read proxy data?
hi there,
i've got a dwg file with some proxy data in it. i'm reading it by calling explode and then iterating through the created subentities. this works fine most of the time but i get an exception thrown from within dwgdirect when the subentity is a 2dpolyline. i have code similar to this :
in the proxy processing class :
void a2dproxy:rocess(oddbproxyentityptr proxy)
{
oddbvoidptrarray entities;
proxy->explode(entities);
for (unsigned i = 0;i < entities.size();++i) {
oddbentityptr ptr = oddbentity::cast(entities.getat(i));
if (!ptr.isnull()) {
// make a correct reader class
create_reader(ptr);
}
}
}
and in the 2dpolyline processing class :
void a2d2dpolyline:rocess(a2d2dpolylineptr poly)
{
oddbobjectiteratorptr vertex_it = poly->vertexiterator();
for (;!vertex_it->done();vertex_it->step()) {
// this next line blows up
oddb2dvertexptr ptr = vertex_it->objectid();
. . .
the 2dpolyline processing class works fine when the data is not part of a proxy.
odamfcapp reads and displays the file fine so i guess i'm doing something wrong, but i cant figure out what it is :-(
any help would be appreciated - thanks.
attached files
explode() method produces non-database resident objects which have no objectid.
try
oddb2dvertexptr ptr = vertex_it->entity();
sergey slezkin
that did the trick. thanks for the quick reply.


所有的时间均为北京时间。 现在的时间是 04:31 AM.