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

Can't add Raster Images: newImageAttach / manipulate

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
con-pnd
1453 Views, 2 Replies

Can't add Raster Images: newImageAttach / manipulate

I am currently trying to use classes AcDbRasterImageDef and AcDbRasterImage and i followed the Examplecode on ObjectARX 2008 Sample ISM: Link: ism example.zip

After some fixes i finally got some tiny results: I finally got through the newImageAttach() function and could see an entity in the Image list. But something went wrong, because i couldn't see that image in my drw. neither in the Raster Design Image-dropdownlist. Take a look at my screenshot:

 

acad.JPG

 

On its status it's "Nicht referenziert", which means "not referenced" and if i try to embed this image, ACAD will close with an Exception. Second problem is, that i couldn't manipulate this image because the line:

 

ErrorStatus = acdbOpenObject((AcDbObject*&) pAcDbRasterImage, parEntityId, AcDb::kForWrite);

returns an ErrorStatus::eNullObjectId which means, that objId is AcDbObjectId::kNull.

 

Could you guys take a look on my code and tell me what i am doing wrong here?

you can take a look at: http://piratepad.net/5HxFq8GBkG

 

Thanks a lot!

Yours sincerely

Philip

2 REPLIES 2
Message 2 of 3
Alexander.Rivilis
in reply to: con-pnd

       if (ErrorStatus != Acad::eOk) {
        // Failed to create Definition.
            ads_printf(_T("Error: Failed to create Definition.\n")); 
            return ErrorStatus;
}

What about  to add braces in your's code? Otherwise, the function returns even if no error.

P.S.: There are a few such places in the code.

Відповідь корисна? Клікніть на "ВПОДОБАЙКУ" цім повідомленням! | Do you find the posts helpful? "LIKE" these posts!
Находите сообщения полезными? Поставьте "НРАВИТСЯ" этим сообщениям!
На ваше запитання відповіли? Натисніть кнопку "ПРИЙНЯТИ РІШЕННЯ" | Have your question been answered successfully? Click "ACCEPT SOLUTION" button.
На ваш вопрос успешно ответили? Нажмите кнопку "УТВЕРДИТЬ РЕШЕНИЕ"


Alexander Rivilis / Александр Ривилис / Олександр Рівіліс
Programmer & Teacher & Helper / Программист - Учитель - Помощник / Програміст - вчитель - помічник
Facebook | Twitter | LinkedIn
Expert Elite Member

Message 3 of 3
con-pnd
in reply to: Alexander.Rivilis

Thx for that advice. I guess i'm a bit lazy, and used to program without (normally programming in Python).

I will try it 🙂

 

 

 

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

Post to forums  

Autodesk Design & Make Report

”Boost