AcDbObjectId PostToModelSpace(AcDbEntity *pEnt) { //定义块表 AcDbBlockTable *pBlk; acdbHostApplicationServices()->workingDatabase()->getSymbolTable(pBlk,AcDb::kForRead); //定义块表记录 AcDbBlockTableRecord *pBlkTblRcd; pBlk->getAt(ACDB_MODEL_SPACE,pBlkTblRcd,AcDb::kForWrite); pBlk->close(); //定义ID AcDbObjectId id; pBlkTblRcd->appendAcDbEntity(id,pEnt); pEnt->close(); return id; }