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

yang686526 2009-05-07 12:24 PM

【转帖】read attribute of block
 
read attribute of block
read attribute of block
visual studio 2005 c++
dwgdirect c++ libraries 2.3.1
i want to operate attribute of block.
coding:
void import::createentity( oddbblockreference* pent, dotcad:atabases:bentities^ entities, blockinfo* pblockinfofff">, int spaceflag )
{
blockinfo* newblockinfo = new blockinfo();
newblockinfo->parentblockinfo = pblockinfo;
newblockinfo->layerid = pent->layerid();
newblockinfo->colorindex = pent->colorindex();
newblockinfo->lineweight = pent->lineweight();
newblockinfo->linetypeid = pent->linetypeid();
odrxobjectptrarray entityset;
odresult result = pent->explode(entityset);
for( unsigned int i = 0; i < entityset.size() ; i++ )
{
if( !entityset[i]->iskindof(oddbattributedefinition::desc()) )
createentity( entityset[i], entities, newblockinfo, spaceflag );
}
for ( oddbobjectiteratorptr pattributeiter = pent->attributeiterator() ; !pattributeiter->done() ; pattributeiter->step() )
{
oddbattributeptr pattribute = pattributeiter->objectid().safeopenobject( oddb::kforread, false );
if( !pattribute->isinvisible() )
createentity( pattribute, entities, newblockinfo, spaceflag );
}
}
if there is bolck in bolock, once more transfers this method, thistime(pblockinfofff"> is not empties), there is exception at "oddbattributeptr pattribute = pattributeiter->objectid().safeopenobject( oddb::kforread, false );fff">".
why?help me.thanks.
you pass oddbattribute* as oddbblockreference* to createentity() how is it possible?
or you have overloaded version?
vladimir


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