static Acad::ErrorStatus PostCurrentSpace(AcDbObjectId &objId,AcDbEntity *pEnt) { Acad::ErrorStatus es=Acad::eNullObjectId; AcDbObjectId blkRcdId=acdbHostApplicationServices()->workingDatabase()->currentSpaceId(); if (AcDbObjectId::kNull != blkRcdId) { AcDbBlockTableRecordPointer pBlkTblRcd(blkRcdId,AcDb::kForWrite); es=pBlkTblRcd.openStatus(); if (Acad::eOk == es) { es= pBlkTblRcd->appendAcDbEntity(objId, pEnt); if (Acad::eOk == es) { pEnt->close(); } } } if (Acad::eOk!=es) { if (pEnt!=NULL) { delete pEnt; pEnt=NULL; } } return es; }