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