Can't add Raster Images: newImageAttach / manipulate

Can't add Raster Images: newImageAttach / manipulate

Anonymous
Not applicable
1,584 Views
2 Replies
Message 1 of 3

Can't add Raster Images: newImageAttach / manipulate

Anonymous
Not applicable

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

0 Likes
Accepted solutions (1)
1,585 Views
2 Replies
Replies (2)
Message 2 of 3

Alexander.Rivilis
Mentor
Mentor
Accepted solution
       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

Anonymous
Not applicable

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

I will try it 🙂

 

 

 

0 Likes