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

yang686526 2009-05-07 04:42 PM

【转帖】ext And Acdbattribute Definition
 
text and acdbattribute definition
text and acdbattribute definition
i have modified the reader example to display text strings that are contained in a dwg file. however some of the text is not being displayed.
// get an entity iterator
oddbobjectiteratorptr pentiter = pblock->newiterator();
// for each entity in the block
for (; !pentiter->done(); pentiter->step())
{
oddbentityptr pent = (pentiter->objectid()).safeopenobject();
if (pent->iskindof(oddbtext::desc()))
{
oddbtextptr penttext = pent;
os << (penttext->textstring()).c_str() << std(endl);
os << std(endl);
}
}
this code displays some of the text, the other text appears to be in a acdbattributedefinition and i have been unable to figure out how to access it.
any help would be appreciated.
claudio
try something like this -
oddbattributedefinitionptr pattdef = pent;/* oddbattributedefinition */
os << "acdbattributedefinition tag - " << pattdef->tag().c_str << std(endl);
os << " " << pattdef->textstring().c_str() << std(endl);
for block references - you will have to drill into the block.
attributes are attached to block reference. to access them use oddbblockreference::attributesiterator().
sergey slezkin


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