|
[code] //-------------------------------------//
> // GetAllText
> //
>
> //-------------------------------------//
> int GetAllText( ads_name pSS )
> {
> AcDbBlockTable *pBlockTable;
> AcDbBlockTableRecord *pBlockTableRecord;
> AcDbBlockTableRecordIterator *pIter;
> AcDbEntity *pEnt;
> AcDbObjectId pId;
> ads_name pEname;
>
> // Get Pointer to BlockTable Object
> acdbCurDwg()->getBlockTable( pBlockTable, AcDb::kForRead );
>
> // Get Pointer to MODEL_SPACE BlockTableRecord
> pBlockTable->getAt( ACDB_MODEL_SPACE, pBlockTableRecord,
> AcDb::kForRead );
> pBlockTable->close();
>
> // Get the Iterator
> if ( pBlockTableRecord->newIterator( pIter ) != Acad::eOk ) {
> pBlockTableRecord->close();
> return( RTERROR );
> }
>
> // Initialize the Selection Set
> acedSSAdd( NULL, NULL, pSS );
>
> // Iterate through the Drawing
> while( !pIter->done()) {
>
> // Get the Entity
> pIter->getEntity( pEnt, AcDb::kForRead );
> if ( pEnt != NULL ) {
> if ( !pEnt->isErased()) {
> pId = pEnt->objectId();
>
> // See if it's Text or Mtext
> if ( pEnt->isKindOf( AcDbText::desc())) {
> // TEXT
> acdbGetAdsName( pEname, pId );
> acedSSAdd( pEname, pSS, pSS );
>
> } else if ( pEnt->isKindOf( AcDbMText::desc())) {
> // MTEXT
> acdbGetAdsName( pEname, pId );
> acedSSAdd( pEname, pSS, pSS );
>
> }
> }
>
> pEnt->close();
> }
>
> // Step to the Next
> pIter->step();
> }
>
> // delete the Iterator
> delete pIter;
>
> // Close the Block Table Record
> pBlockTableRecord->close();
>
> return( RTNORM );
> }[/code] |
|