When saving some geometry to a drawing file using the wblock command like so
acedCommandS(RTSTR, _T("_wblock"), RTSTR, flname, RTSTR, _T(""), RT3DPOINT, inspt, RTPICKS, set1, RTSTR, _T(""), NULL);
We do not get a thumbnail image with the drawing. It works fine in all previous versions that we can test. Same code in all of them. What has changed in 2021 that we need to trap for? It is like a variable is not set, but we have checked on every system and they are all set to create the thumbnail.
I noticed that you never got a response to your question here. Were you able to solve this issue elsewhere or on your own? I'm seeing the same thing still happening in version 2022 as well.
I did get a reply from Autodesk directly and they said that I can run the following code to force it to be created. I still have to do this in 2022 as well. 2023 seems to have it fixed, but we have not tested it in all cases yet.
typedef Acad::ErrorStatus(*MakePreviewFuncType)(AcDbDatabase *pDb, bool bUseCurrentViewInfo);
Acad::ErrorStatus es;
AcDbDatabase *pDb = new AcDbDatabase(false, true);
es = pDb->readDwgFile(flname);
pDb->setRetainOriginalThumbnailBitmap(false);
HINSTANCE hInst;
if((hInst = LoadLibrary(L"acblock.crx")) != NULL)
{
MakePreviewFuncType makePreviewFunc;
if((makePreviewFunc = (MakePreviewFuncType)GetProcAddress(hInst, "acdbMakeDrawingPreview")) != NULL)
{
if(makePreviewFunc(pDb, false) == Acad::eOk)
pDb->saveAs(flname);
}
FreeLibrary(hInst);
}
delete pDb;
Can't find what you're looking for? Ask the community or share your knowledge.