|
Acad::ErrorStatus postToDatabase (/*[in]*/AcDbDatabase *pDb /*=NULL*/, AcDbEntity *pEnt, AcDbObjectId &idObj);[code]Acad::ErrorStatus postToDatabase (/*[in]*/AcDbDatabase *pDb /*=NULL*/, AcDbEntity *pEnt, AcDbObjectId &idObj) {
assert ( pEnt != NULL ) ;
if ( pDb == NULL )
pDb =acdbHostApplicationServices ()->workingDatabase () ;
Acad::ErrorStatus es ;
AcDbBlockTable *pBlockTable ;
if ( (es =pDb->getBlockTable (pBlockTable, AcDb::kForRead)) == Acad::eOk ) {
AcDbBlockTableRecord *pSpaceRecord ;
if ( (es =pBlockTable->getAt (ACDB_MODEL_SPACE, pSpaceRecord, AcDb::kForWrite)) == Acad::eOk ) {
if ( (es =pSpaceRecord->appendAcDbEntity (idObj, pEnt)) == Acad::eOk )
pEnt->close () ;
pSpaceRecord->close () ;
}
pBlockTable->close () ;
}
return (es) ;
}[/code] |
|