![]() |
【转帖】exploding block refs and maintaining layers
exploding block refs and maintaining layers
exploding block refs and maintaining layers i'm currently having a problem where after using the explodetoblock functionality i lose any layer information i may have originally placed in the reference block i explode. for example in the code below, after reaching the inner-most if statement and exploding the block reference there seems to be a complete loss of layer information stored in that reference, instead i seem to be left with the empty layer information from the block itself. code: oddbobjectid msid = pdb->getmodelspaceid(); oddbblocktablerecordptr pms = pdb->getmodelspaceid().safeopenobject(oddb::kforwrite); oddbobjectiteratorptr pmsents = pms->newiterator(); oddbobjectidarray idstoexplode; while (!pmsents->done()) { oddbobjectid entid = pmsents->objectid(); oddbentityptr pmsent = oddbentity::cast(entid.openobject(oddb::kforwrite)); if (pmsent->iskindof(oddbblockreference::desc())) { oddbblockreferenceptr pblock = pmsent; if (pmsent->explodetoblock(pms) == eok) { idstoexplode.push_back(entid); } } is there a way to fix this? (also if there is any need to clearify i will, sorry about the previous post) thanks. when block reference is exploded all block reference properties (layer, color, linetype etc.) are lost. this is "as designed" behavior. autocad does the same. for example a block reference is on layer_1 and the block contains line on layer "0". layer "0" inside the block means "default layer" - layer of block reference is used in such case. after exploding the block reference you see the line on layer "0". during explode properties of entities are not changed. but appearence may change (byblock properties is another case). also note that as a result of exploding block reference attribute entities (oddbattribute) are lost. sergey slezkin |
所有的时间均为北京时间。 现在的时间是 02:27 AM. |