查看单个帖子
旧 2009-05-07, 12:24 PM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】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
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)