- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Problem Statement: I am trying to retrieve the path of the attached reference images.
The use case is insert>>reference>>attach>>image file.
I have Identified that this is a AcDbRasterImage and I tried to cast it to AcDbRasterImagedef object to find the path by using the apis , AcDbRaterImageDef::activeFileName() and AcDbRaterImageDef::sourceFileName() of AcDbRasterImageDef but the values retrieved are ambiguous.
In second method, I used AcDbRasterImageDef::imageDictionary(acdbCurDwg()) and tried to iterate through the dictionary to get objectId and the database but this method gives me the path of the parent drawing and not the path of the image source, although I think I have written this incorrectly, pardon me I am using AutoCAD API foe the first time :).
If someone knows how to get the path of attached reference, it would be great!
AcDbObjectId dicoId;
AcDbDictionary* pDict;
dicoId = AcDbRasterImageDef::imageDictionary(acdbCurDwg());
eErrStatus = acdbOpenObject((AcDbObject*&)pDict, dicoId, AcDb::kForRead);
AcDbDictionaryIterator* dictItr = NULL;
dictItr = pDict->newIterator();
for(; dictItr != NULL && !dictItr->done(); dictItr->next())
{
AcDbObject* currentEntObj;
eErrStatus = dictItr->getObject(currentEntObj, AcDb::kForRead);
AcDbObjectId objId = currentEntObj->objectId();
AcDbDatabase* db = dicoId.originalDatabase();
const ACHAR* pcFilename = NULL;
db->getFilename(pcFilename);
}
Thanks!
Solved! Go to Solution.