高级会员
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
|
【转帖】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
|