Wblock returns eWrongDatabase

Wblock returns eWrongDatabase

Rehm_AutodeskLogin
Participant Participant
1,067 Views
3 Replies
Message 1 of 4

Wblock returns eWrongDatabase

Rehm_AutodeskLogin
Participant
Participant

My app tries to export some entities to an new external database using this code:

 

Acad::ErrorStatus es;
AcDbDatabase* pDb = new AcDbDatabase(true);
es = acdbHostApplicationServices()->workingDatabase()->wblock(pDb, entsArray, AcGePoint3d::kOrigin);
es = pDb->saveAs(file);
delete pDb;
return;

 

It doesn't work because wblock returns eWrongDatabase.

 

Does anyone have an idea why that happens?

 

Cheers Dieter

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

Alexander.Rivilis
Mentor
Mentor
Accepted solution

1.

AcDbDatabase* pDb = new AcDbDatabase(false, true);

2.  All ids in entsArray are from  acdbHostApplicationServices()->workingDatabase() ?

Відповідь корисна? Клікніть на "ВПОДОБАЙКУ" цім повідомленням! | 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 4

Rehm_AutodeskLogin
Participant
Participant

1. If if create a new instance of acdbDatabase with AcDbDatabase *pDb = new AcDbDatabase(false, true) 

wblock returns also eWrongDatabase

2. Yes, all Ids in entsArray are from  acdbHostApplicationServices()->workingDatabase()

0 Likes
Message 4 of 4

Rehm_AutodeskLogin
Participant
Participant
Accepted solution

Sorry, my mistake 😞

entsArray contained some invalid object Ids. If all ids are valied, wblock works as excepcted.

Cheers Dieter

0 Likes