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

wblock not saving thumbnails in 2021

3 REPLIES 3
Reply
Message 1 of 4
dinomyar
509 Views, 3 Replies

wblock not saving thumbnails in 2021

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.

3 REPLIES 3
Message 2 of 4
jhay2019
in reply to: dinomyar

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.

Message 3 of 4
dinomyar
in reply to: jhay2019

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;

Message 4 of 4
jhay2019
in reply to: dinomyar

I see.  Thanks for the reply dinomyar!

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

Post to forums  

Forma Design Contest


AutoCAD Beta