- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Or has something changed?
static void ArxTemplate_doit(void)
{
constexpr const wchar_t* itemName = L"MY_IMAGE_NAME";
AcDbDatabase* pDb = acdbHostApplicationServices()->workingDatabase();
AcDbObjectId imageDictId = AcDbRasterImageDef::imageDictionary(pDb);
if (imageDictId.isNull())
{
if (auto es = AcDbRasterImageDef::createImageDictionary(pDb, imageDictId); es != eOk)
acutPrintf(acadErrorStatusText(es));
}
AcDbObjectPointer<AcDbRasterImageDef>imageDef;
if(auto es = imageDef.create(); es != eOk)
acutPrintf(acadErrorStatusText(es));
if (auto es = imageDef->setSourceFileName(L"C:\\Users\\Dan\\Pictures\\vb.jpg"); es != eOk)
acutPrintf(acadErrorStatusText(es));
if (auto es = imageDef->load(); es != eOk)
acutPrintf(acadErrorStatusText(es));
AcDbDictionaryPointer imageDict(imageDictId, AcDb::OpenMode::kForWrite);
if (auto es = imageDict.openStatus(); es != eOk)
acutPrintf(acadErrorStatusText(es));
AcDbObjectId imageDefId;
if (auto es = imageDict->setAt(itemName, imageDef, imageDefId); es != eOk)
acutPrintf(acadErrorStatusText(es));
}
eNoClassId
~Dan
Python for AutoCAD, Python wrappers for ARX https://github.com/CEXT-Dan/PyRx
Solved! Go to Solution.