几何尺寸与公差论坛------致力于产品几何量公差标准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)
-   -   【转帖】get list of attribute tags (http://www.dimcax.com/hust/showthread.php?t=16371)

yang686526 2009-05-05 11:16 AM

【转帖】get list of attribute tags
 
get list of attribute tags
get list of attribute tags
i'm trying to list down the attribute tags for all the blocks. this is what i'm doing:
oddbblocktablerecordptr pblock = pblkiter->getrecordid().safeopenobject();
oddbobjectiteratorptr pentiter = pblock->newiterator();
for (pentiter->start(); ! pentiter->done(); pentiter->step())
{
oddbentityptr pent = pentiter->entity();
if (pent->iskindof(oddbtext::desc())) {
print(tostring(otext->textstring()));
}
}
otext->textstring() print blank data.
i have another query. is it going to iterate thru all the instances of the block? if yes, this will be a waste of time bcoz i just need the attribute tag name. how can i get only the attribute tag for a block without iterating thru all the instances?
if you look for attribute definitions, then cast entity to oddbattributedefinition, and ask it for 'tag'
vladimir


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