get orientation from active Raster Image
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Dear ObjectArx Programmers,
It's me again and this time would ask you, why my function getRasterImageInfo is failing getting the Orientation from my active Raster Image (After pRastImg->getOrientation(origin, u, v) all values are still empty).
I also found some intressting top on the Autodesk Dev Blog (http://adndevblog.typepad.com/autocad/2012/05/finding-all-the-visible-raster-images-in-the-drawing.h... but can't do it like this.
One of the problems: Where are datatype Document,Database and Editor coming from? Could i use AcApDocument and AcDbDatabase instead? Thx a lot guys!
void getRasterImageInfo(AcGePoint3d& origin, AcGeVector3d& u, AcGeVector3d& v)
{
AcDbBlockTable *pBT = NULL;
AcDbBlockTableRecord *pBTR =NULL;
AcDbBlockTableRecordIterator *pBTIter;
Acad:: ErrorStatus es;
AcApDocument *pDoc=acDocManager->curDocument(); // Lock Document
acDocManager->lockDocument(pDoc,AcAp::kWrite);
//acdbHostApplicationServices()->workingDatabase()->getBlockTable(pBT,AcDb::kForRead);
AcDbDatabase* pDB = acdbHostApplicationServices()->workingDatabase();
es = pDB->getSymbolTable(pBT, AcDb::kForRead);
pBT->getAt(ACDB_MODEL_SPACE,pBTR,AcDb::kForRead);
pBTR->newIterator(pBTIter);
pBT->close();
pBTR->close();
AcDbEntity *pEnt;
AcDbRasterImage *pRastImg;
bool rasterFound = false;
while (!(pBTIter->done()))
{
pBTIter->getEntity(pEnt,AcDb::kForRead);
pRastImg = AcDbRasterImage::cast(pEnt);
if(NULL != pRastImg)
{
rasterFound = true;
AcGeVector3d u;
AcGeVector3d v;
pRastImg->getOrientation(origin, u, v);
}
pEnt->close();
pBTIter->step();
}
delete pBTIter;
acDocManager->unlockDocument(pDoc); // Unlock Document
}
Greetings