AcDbAttribute* pAtt = new AcDbAttribute();
pAtt->setPropertiesFrom(pAttDef);
AcGePoint3d attPos = pAttDef->position();
attPos += pBlkRef->position().asVector();
pAtt->setPosition(attPos);
pAtt->setHeight(pAttDef->height());
pAtt->setTag(pAttDef->tag());
pAtt->setTextString(pAttDef->textString());
Acad::ErrorStatus es = pBlkRef->appendAttribute(pAtt);
if (es != Acad::eOk) {
pAtt->erase();
}
pAtt->close();