CHostApp app;
// create a new database to read our drawing into
AcDbDatabase data(Adesk::kFalse);
data.readDwgFile(ofn.lpstrFile);
AcDbBlockTableRecordPointer spaceRec(ACDB_MODEL_SPACE, &data, AcDb::kForRead);
AcDbBlockTableRecordIterator* itor = 0;
spaceRec->newIterator(itor);
for (; !itor->done(); itor->step())
{
AcDbObjectId entityId;
itor->getEntityId(entityId);
AcDbEntityPointer entity(entityId,AcDb::kForRead);
if (entity.openStatus() == Acad::eOk)
{
LPCTSTR sDxf = entity->isA()->dxfName();
int il=0;
}
}
delete itor;
1