|
高级会员
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
|
【转帖】ranslation Of Oddbattribute
translation of oddbattribute
translation of oddbattribute
hello,
for the attached drawing i apply:
code:
oddbdatabaseptr pdatabase = ...;
oddbobjectid idmodelspaceblock = pdatabase->getmodelspaceid();
oddbblocktablerecordptr pmodelspace = idmodelspaceblock.safeopenobject(oddb::kforread);
oddbobjectiteratorptr pit = pmodelspace->newiterator();
oddbobjectid idreference = 0;
bool bfound = false;
for (pit->start(); !pit->done(); pit->step()){
oddbobjectid idcurrent = pit->objectid();
oddbentityptr pent = idcurrent.safeopenobject(oddb::kforread);
if ( pent->iskindof(oddbblockreference::desc()) ){
idreference = idcurrent;
bfound = true;
}
}
if (bfound){
oddbblockreferenceptr preference = idreference.safeopenobject(oddb::kforwrite);
oddbobjectiteratorptr pit = preference->attributeiterator();
pit->start();
if (!pit->done()){
oddbattributeptr pattribute = pit->objectid().safeopenobject(oddb::kforwrite);
odgematrix3d mtranslate = odgematrix3d::translation(odgevector3d(16000.,0.,0.));
pattribute->transformby(mtranslate);
}
}as a result i have two images of the attribute.
what is the problem?
thanks,
mihail.
hi,
model space includes block reference with attribute. block reference links to blocktablerecord (name - block) with attribute definition. blocktablerecord with attribute definition is a 'template' for the block reference.
transfromby operation for attribute is valid. autocad after such transfrom draws two texts also. so there is no defect here. two text appears due to block reference worldraw method implementation. it calls worldraw for blocktablerecord with attribute definition (for 'template') and worldraw for all subelements of block reference after. it draws two texts before transform also... just in the same position.
well, i think that you know about constant flag of attribute definition... just disable it and only one text will be rendered.
last edited by sslezkin; 7th august 2008 at 07:36 amfff">.
how to find block boundary?
hi all!
model space includes block reference with attribute. now i want to find where is block reference (with attribute). when mouse move, i want to know it move over this block or not. how can i do this?
expecting your reply soon!
thank you!
trang
hi,
please investigate our sample mfcapp. it has some selection entity functionality implemented. may be it helps you.
|