This is how you can draw the entities in the block with the block transformation of the BREF:
void DrawBref(AcGiWorldDraw *mode, AcDbBlockReference* bref)
{
AcDbBlockTableRecord *block;
Acad::ErrorStatus es;
if ((es = acdbOpenObject(block, bref->blockTableRecord(), AcDb::kForRead)) == Acad::eOk)
{
AcDbBlockTableRecordIterator* blkIter = 0;
if (block->newIterator(blkIter) == Acad::eOk) {
AcDbEntity* ent;
mode->geometry().pushModelTransform(bref->blockTransform());
for (; !blkIter->done(); blkIter->step()) {
if (blkIter->getEntity(ent, AcDb::kForRead) == Acad::eOk) {
mode->geometry().draw(ent);
ent->close();
}
}
mode->geometry().popModelTransform();
delete blkIter;
}
block->close();
}
}
Thomas Brammer ● Software Developer ● imos AG ● LinkedIn ●
If an answer solves your problem please [ACCEPT SOLUTION]. Otherwise explain why not.