ObjectARX
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

AcDbRasterImageDef 2025 bug?

3 REPLIES 3
SOLVED
Reply
Message 1 of 4
daniel_cadext
247 Views, 3 Replies

AcDbRasterImageDef 2025 bug?

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
3 REPLIES 3
Message 2 of 4

oops

Python for AutoCAD, Python wrappers for ARX https://github.com/CEXT-Dan/PyRx
Message 3 of 4

oops

Python for AutoCAD, Python wrappers for ARX https://github.com/CEXT-Dan/PyRx
Message 4 of 4

i just needed to load the dbx

 auto acismobj = std::format(_T("acismobj{}.dbx"), acdbHostApplicationServices()->releaseMajorVersion());
 if (auto result = acrxLoadModule(acismobj.c_str(), false, false); !result)
     acutPrintf(_T("Faled to load %ls: "), acismobj);
Python for AutoCAD, Python wrappers for ARX https://github.com/CEXT-Dan/PyRx

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost