2007/utils/amodeler/samples/asdkbodyapp/asdkbodyui/AsdkBodyUi.cpp
//utility function that appends an entity to the model space

utility function that appends an entity to the model space
utility function that appends an entity to the model space
Adesk::Boolean append( AcDbEntity* pEnt )
{
    AcDbBlockTable *pBt;
	AcDbDatabase* pDb = acdbHostApplicationServices()->workingDatabase();
    if (Acad::eOk != pDb->getBlockTable( pBt, AcDb::kForRead ))
        return Adesk::kFalse;
    AcDbBlockTableRecord *pMs;
    Acad::ErrorStatus es = pBt->getAt( ACDB_MODEL_SPACE, pMs,
        AcDb::kForWrite );
    pBt->close();
    if (Acad::eOk != es)
        return Adesk::kFalse;
    es = pMs->appendAcDbEntity( pEnt );
    pMs->close();
    return Acad::eOk == es;
}
Adesk :: Boolean append ( AcDbEntity * pEnt ) { AcDbBlockTable * pBt ; AcDbDatabase * pDb = acdbHostApplicationServices ( ) -> workingDatabase ( ) ; if ( Acad :: eOk != pDb -> getBlockTable ( pBt , AcDb :: kForRead ) ) return Adesk :: kFalse ; AcDbBlockTableRecord * pMs ; Acad :: ErrorStatus es = pBt -> getAt ( ACDB_MODEL_SPACE , pMs , AcDb :: kForWrite ) ; pBt -> close ( ) ; if ( Acad :: eOk != es ) return Adesk :: kFalse ; es = pMs -> appendAcDbEntity ( pEnt ) ; pMs -> close ( ) ; return Acad :: eOk == es ; }
utility function that appends an entity to the model space
utility function that appends an entity to the model space