<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Generate preview in ObjectARX Forum</title>
    <link>https://forums.autodesk.com/t5/objectarx-forum/generate-preview/m-p/1616838#M23832</link>
    <description>Art:&lt;BR /&gt;
It indeed returns NULL.&lt;BR /&gt;
I am aware of the fact that wblock() doesn't create thumbnails, i'm just&lt;BR /&gt;
looking for a way around it.&lt;BR /&gt;
thanks&lt;BR /&gt;
&lt;BR /&gt;
alex&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
"Art Cooney" &lt;ARTC&gt; wrote in message&lt;BR /&gt;
news:5147493@discussion.autodesk.com...&lt;BR /&gt;
How is it failing?&lt;BR /&gt;
&lt;BR /&gt;
wblock() won't create a thumbnail in the database it is writing to, so&lt;BR /&gt;
pNewDB-&amp;gt;thumbnailBitmap() should return NULL.&lt;BR /&gt;
&lt;BR /&gt;
"alex" &lt;ALEXB&gt; wrote in message&lt;BR /&gt;
news:5146780@discussion.autodesk.com...&lt;BR /&gt;
Hi,&lt;BR /&gt;
&lt;BR /&gt;
I'm trying using AcDbDatabase::thumbnailBitmap() and&lt;BR /&gt;
AcDbDatabase::setThumbnailBitmap()&lt;BR /&gt;
to generate a preview thumbnail on a new database before saving it, but it&lt;BR /&gt;
fails on thumbnailBitmap().&lt;BR /&gt;
&lt;BR /&gt;
Here is the code: (ObjectArx2002), no error checking&lt;BR /&gt;
&lt;BR /&gt;
  AcDbDatabase *pNewDB = NULL;//new database;&lt;BR /&gt;
  es = acdbHostApplicationServices()-&amp;gt;workingDatabase()-&amp;gt;wblock(pNewDB,&lt;BR /&gt;
id);//add something to it&lt;BR /&gt;
  void * pThumbnail = pNewDB-&amp;gt;thumbnailBitmap();//fails here&lt;BR /&gt;
  pNewDB-&amp;gt;setThumbnailBitmap(pThumbnail);&lt;BR /&gt;
&lt;BR /&gt;
The documentation is not very clear (or extensive) so i'm not sure i do the&lt;BR /&gt;
right thing&lt;BR /&gt;
TIA&lt;BR /&gt;
&lt;BR /&gt;
alex&lt;/ALEXB&gt;&lt;/ARTC&gt;</description>
    <pubDate>Thu, 20 Apr 2006 03:43:56 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2006-04-20T03:43:56Z</dc:date>
    <item>
      <title>Generate preview</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/generate-preview/m-p/1616834#M23828</link>
      <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
I'm trying using AcDbDatabase::thumbnailBitmap() and&lt;BR /&gt;
AcDbDatabase::setThumbnailBitmap()&lt;BR /&gt;
to generate a preview thumbnail on a new database before saving it, but it&lt;BR /&gt;
fails on thumbnailBitmap().&lt;BR /&gt;
&lt;BR /&gt;
Here is the code: (ObjectArx2002), no error checking&lt;BR /&gt;
&lt;BR /&gt;
  AcDbDatabase *pNewDB = NULL;//new database;&lt;BR /&gt;
  es = acdbHostApplicationServices()-&amp;gt;workingDatabase()-&amp;gt;wblock(pNewDB,&lt;BR /&gt;
id);//add something to it&lt;BR /&gt;
  void * pThumbnail = pNewDB-&amp;gt;thumbnailBitmap();//fails here&lt;BR /&gt;
  pNewDB-&amp;gt;setThumbnailBitmap(pThumbnail);&lt;BR /&gt;
&lt;BR /&gt;
The documentation is not very clear (or extensive) so i'm not sure i do the&lt;BR /&gt;
right thing&lt;BR /&gt;
TIA&lt;BR /&gt;
&lt;BR /&gt;
alex</description>
      <pubDate>Wed, 19 Apr 2006 05:23:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/generate-preview/m-p/1616834#M23828</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-04-19T05:23:17Z</dc:date>
    </item>
    <item>
      <title>Re: Generate preview</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/generate-preview/m-p/1616835#M23829</link>
      <description>Hello Alex,&lt;BR /&gt;
&lt;BR /&gt;
I don't know the answer. But I would try to&lt;BR /&gt;
&lt;BR /&gt;
- save the database (at first with database-&amp;gt;saveAs, if not work: second with Doc-&amp;gt;Save)&lt;BR /&gt;
&lt;BR /&gt;
- load the database&lt;BR /&gt;
&lt;BR /&gt;
and then (in the hope, acad has created the thumbnail) try to access to the thumbnail.&lt;BR /&gt;
&lt;BR /&gt;
Please see also the acad help:&lt;BR /&gt;
&lt;BR /&gt;
Note These APIs are meant primarily for ObjectDBX developers. Preview thumbnail behavior reflect what the host application must do&lt;BR /&gt;
to generate a preview.&lt;BR /&gt;
&lt;BR /&gt;
For ObjectARX developers AutoCAD is taking care of all preview thumbnail generation. ObjectARX users should leave these APIs alone,&lt;BR /&gt;
and allow AutoCAD behaviors to prevail.&lt;BR /&gt;
&lt;BR /&gt;
doc snyder&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
"alex" &lt;ALEXB&gt; schrieb im Newsbeitrag news:5146780@discussion.autodesk.com...&lt;BR /&gt;
Hi,&lt;BR /&gt;
&lt;BR /&gt;
I'm trying using AcDbDatabase::thumbnailBitmap() and&lt;BR /&gt;
AcDbDatabase::setThumbnailBitmap()&lt;BR /&gt;
to generate a preview thumbnail on a new database before saving it, but it&lt;BR /&gt;
fails on thumbnailBitmap().&lt;BR /&gt;
&lt;BR /&gt;
Here is the code: (ObjectArx2002), no error checking&lt;BR /&gt;
&lt;BR /&gt;
  AcDbDatabase *pNewDB = NULL;//new database;&lt;BR /&gt;
  es = acdbHostApplicationServices()-&amp;gt;workingDatabase()-&amp;gt;wblock(pNewDB,&lt;BR /&gt;
id);//add something to it&lt;BR /&gt;
  void * pThumbnail = pNewDB-&amp;gt;thumbnailBitmap();//fails here&lt;BR /&gt;
  pNewDB-&amp;gt;setThumbnailBitmap(pThumbnail);&lt;BR /&gt;
&lt;BR /&gt;
The documentation is not very clear (or extensive) so i'm not sure i do the&lt;BR /&gt;
right thing&lt;BR /&gt;
TIA&lt;BR /&gt;
&lt;BR /&gt;
alex&lt;/ALEXB&gt;</description>
      <pubDate>Wed, 19 Apr 2006 14:58:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/generate-preview/m-p/1616835#M23829</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-04-19T14:58:06Z</dc:date>
    </item>
    <item>
      <title>Re: Generate preview</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/generate-preview/m-p/1616836#M23830</link>
      <description>Hello doc snyder&lt;BR /&gt;
&lt;BR /&gt;
From the docs:&lt;BR /&gt;
&lt;BR /&gt;
Acad::ErrorStatus AcDbDatabase::saveAs(const char* fileName);&lt;BR /&gt;
...&lt;BR /&gt;
If the database executing the saveAs() function is not the current database&lt;BR /&gt;
in the AutoCAD editor, then the thumbnail preview image is NOT saved to&lt;BR /&gt;
fileName.&lt;BR /&gt;
&lt;BR /&gt;
I don't need the thumbnail, I just want the db to be saved with a thumbnail,&lt;BR /&gt;
for the next time someone opens it.&lt;BR /&gt;
&lt;BR /&gt;
alex&lt;BR /&gt;
&lt;BR /&gt;
"doc snyder" &lt;NOSPAM&gt; wrote in message&lt;BR /&gt;
news:5147232@discussion.autodesk.com...&lt;BR /&gt;
Hello Alex,&lt;BR /&gt;
&lt;BR /&gt;
I don't know the answer. But I would try to&lt;BR /&gt;
&lt;BR /&gt;
- save the database (at first with database-&amp;gt;saveAs, if not work: second&lt;BR /&gt;
with Doc-&amp;gt;Save)&lt;BR /&gt;
&lt;BR /&gt;
- load the database&lt;BR /&gt;
&lt;BR /&gt;
and then (in the hope, acad has created the thumbnail) try to access to the&lt;BR /&gt;
thumbnail.&lt;BR /&gt;
&lt;BR /&gt;
Please see also the acad help:&lt;BR /&gt;
&lt;BR /&gt;
Note These APIs are meant primarily for ObjectDBX developers. Preview&lt;BR /&gt;
thumbnail behavior reflect what the host application must do&lt;BR /&gt;
to generate a preview.&lt;BR /&gt;
&lt;BR /&gt;
For ObjectARX developers AutoCAD is taking care of all preview thumbnail&lt;BR /&gt;
generation. ObjectARX users should leave these APIs alone,&lt;BR /&gt;
and allow AutoCAD behaviors to prevail.&lt;BR /&gt;
&lt;BR /&gt;
doc snyder&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
"alex" &lt;ALEXB&gt; schrieb im Newsbeitrag&lt;BR /&gt;
news:5146780@discussion.autodesk.com...&lt;BR /&gt;
Hi,&lt;BR /&gt;
&lt;BR /&gt;
I'm trying using AcDbDatabase::thumbnailBitmap() and&lt;BR /&gt;
AcDbDatabase::setThumbnailBitmap()&lt;BR /&gt;
to generate a preview thumbnail on a new database before saving it, but it&lt;BR /&gt;
fails on thumbnailBitmap().&lt;BR /&gt;
&lt;BR /&gt;
Here is the code: (ObjectArx2002), no error checking&lt;BR /&gt;
&lt;BR /&gt;
  AcDbDatabase *pNewDB = NULL;//new database;&lt;BR /&gt;
  es = acdbHostApplicationServices()-&amp;gt;workingDatabase()-&amp;gt;wblock(pNewDB,&lt;BR /&gt;
id);//add something to it&lt;BR /&gt;
  void * pThumbnail = pNewDB-&amp;gt;thumbnailBitmap();//fails here&lt;BR /&gt;
  pNewDB-&amp;gt;setThumbnailBitmap(pThumbnail);&lt;BR /&gt;
&lt;BR /&gt;
The documentation is not very clear (or extensive) so i'm not sure i do the&lt;BR /&gt;
right thing&lt;BR /&gt;
TIA&lt;BR /&gt;
&lt;BR /&gt;
alex&lt;/ALEXB&gt;&lt;/NOSPAM&gt;</description>
      <pubDate>Wed, 19 Apr 2006 15:36:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/generate-preview/m-p/1616836#M23830</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-04-19T15:36:19Z</dc:date>
    </item>
    <item>
      <title>Re: Generate preview</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/generate-preview/m-p/1616837#M23831</link>
      <description>How is it failing?&lt;BR /&gt;
&lt;BR /&gt;
wblock() won't create a thumbnail in the database it is writing to, so &lt;BR /&gt;
pNewDB-&amp;gt;thumbnailBitmap() should return NULL.&lt;BR /&gt;
&lt;BR /&gt;
"alex" &lt;ALEXB&gt; wrote in message &lt;BR /&gt;
news:5146780@discussion.autodesk.com...&lt;BR /&gt;
Hi,&lt;BR /&gt;
&lt;BR /&gt;
I'm trying using AcDbDatabase::thumbnailBitmap() and&lt;BR /&gt;
AcDbDatabase::setThumbnailBitmap()&lt;BR /&gt;
to generate a preview thumbnail on a new database before saving it, but it&lt;BR /&gt;
fails on thumbnailBitmap().&lt;BR /&gt;
&lt;BR /&gt;
Here is the code: (ObjectArx2002), no error checking&lt;BR /&gt;
&lt;BR /&gt;
  AcDbDatabase *pNewDB = NULL;//new database;&lt;BR /&gt;
  es = acdbHostApplicationServices()-&amp;gt;workingDatabase()-&amp;gt;wblock(pNewDB,&lt;BR /&gt;
id);//add something to it&lt;BR /&gt;
  void * pThumbnail = pNewDB-&amp;gt;thumbnailBitmap();//fails here&lt;BR /&gt;
  pNewDB-&amp;gt;setThumbnailBitmap(pThumbnail);&lt;BR /&gt;
&lt;BR /&gt;
The documentation is not very clear (or extensive) so i'm not sure i do the&lt;BR /&gt;
right thing&lt;BR /&gt;
TIA&lt;BR /&gt;
&lt;BR /&gt;
alex&lt;/ALEXB&gt;</description>
      <pubDate>Wed, 19 Apr 2006 16:57:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/generate-preview/m-p/1616837#M23831</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-04-19T16:57:59Z</dc:date>
    </item>
    <item>
      <title>Re: Generate preview</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/generate-preview/m-p/1616838#M23832</link>
      <description>Art:&lt;BR /&gt;
It indeed returns NULL.&lt;BR /&gt;
I am aware of the fact that wblock() doesn't create thumbnails, i'm just&lt;BR /&gt;
looking for a way around it.&lt;BR /&gt;
thanks&lt;BR /&gt;
&lt;BR /&gt;
alex&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
"Art Cooney" &lt;ARTC&gt; wrote in message&lt;BR /&gt;
news:5147493@discussion.autodesk.com...&lt;BR /&gt;
How is it failing?&lt;BR /&gt;
&lt;BR /&gt;
wblock() won't create a thumbnail in the database it is writing to, so&lt;BR /&gt;
pNewDB-&amp;gt;thumbnailBitmap() should return NULL.&lt;BR /&gt;
&lt;BR /&gt;
"alex" &lt;ALEXB&gt; wrote in message&lt;BR /&gt;
news:5146780@discussion.autodesk.com...&lt;BR /&gt;
Hi,&lt;BR /&gt;
&lt;BR /&gt;
I'm trying using AcDbDatabase::thumbnailBitmap() and&lt;BR /&gt;
AcDbDatabase::setThumbnailBitmap()&lt;BR /&gt;
to generate a preview thumbnail on a new database before saving it, but it&lt;BR /&gt;
fails on thumbnailBitmap().&lt;BR /&gt;
&lt;BR /&gt;
Here is the code: (ObjectArx2002), no error checking&lt;BR /&gt;
&lt;BR /&gt;
  AcDbDatabase *pNewDB = NULL;//new database;&lt;BR /&gt;
  es = acdbHostApplicationServices()-&amp;gt;workingDatabase()-&amp;gt;wblock(pNewDB,&lt;BR /&gt;
id);//add something to it&lt;BR /&gt;
  void * pThumbnail = pNewDB-&amp;gt;thumbnailBitmap();//fails here&lt;BR /&gt;
  pNewDB-&amp;gt;setThumbnailBitmap(pThumbnail);&lt;BR /&gt;
&lt;BR /&gt;
The documentation is not very clear (or extensive) so i'm not sure i do the&lt;BR /&gt;
right thing&lt;BR /&gt;
TIA&lt;BR /&gt;
&lt;BR /&gt;
alex&lt;/ALEXB&gt;&lt;/ARTC&gt;</description>
      <pubDate>Thu, 20 Apr 2006 03:43:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/generate-preview/m-p/1616838#M23832</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-04-20T03:43:56Z</dc:date>
    </item>
    <item>
      <title>Re: Generate preview</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/generate-preview/m-p/1616839#M23833</link>
      <description>If you're aware that it returns NULL, then what do you mean by it "fails"?&lt;BR /&gt;
&lt;BR /&gt;
There isn't any way to get wblock to create a thumbnail.  The thumbnail is &lt;BR /&gt;
generated by our graphics system and requires that the drawing be loaded in &lt;BR /&gt;
the AutoCAD editor.  The only way to get AutoCAD to put a thumbnail in the &lt;BR /&gt;
drawing created by the wblock would be to open that drawing in the AutoCAD &lt;BR /&gt;
editor and then save it.&lt;BR /&gt;
&lt;BR /&gt;
"alex" &lt;ALEXB&gt; wrote in message &lt;BR /&gt;
news:5148244@discussion.autodesk.com...&lt;BR /&gt;
Art:&lt;BR /&gt;
It indeed returns NULL.&lt;BR /&gt;
I am aware of the fact that wblock() doesn't create thumbnails, i'm just&lt;BR /&gt;
looking for a way around it.&lt;BR /&gt;
thanks&lt;BR /&gt;
&lt;BR /&gt;
alex&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
"Art Cooney" &lt;ARTC&gt; wrote in message&lt;BR /&gt;
news:5147493@discussion.autodesk.com...&lt;BR /&gt;
How is it failing?&lt;BR /&gt;
&lt;BR /&gt;
wblock() won't create a thumbnail in the database it is writing to, so&lt;BR /&gt;
pNewDB-&amp;gt;thumbnailBitmap() should return NULL.&lt;BR /&gt;
&lt;BR /&gt;
"alex" &lt;ALEXB&gt; wrote in message&lt;BR /&gt;
news:5146780@discussion.autodesk.com...&lt;BR /&gt;
Hi,&lt;BR /&gt;
&lt;BR /&gt;
I'm trying using AcDbDatabase::thumbnailBitmap() and&lt;BR /&gt;
AcDbDatabase::setThumbnailBitmap()&lt;BR /&gt;
to generate a preview thumbnail on a new database before saving it, but it&lt;BR /&gt;
fails on thumbnailBitmap().&lt;BR /&gt;
&lt;BR /&gt;
Here is the code: (ObjectArx2002), no error checking&lt;BR /&gt;
&lt;BR /&gt;
  AcDbDatabase *pNewDB = NULL;//new database;&lt;BR /&gt;
  es = acdbHostApplicationServices()-&amp;gt;workingDatabase()-&amp;gt;wblock(pNewDB,&lt;BR /&gt;
id);//add something to it&lt;BR /&gt;
  void * pThumbnail = pNewDB-&amp;gt;thumbnailBitmap();//fails here&lt;BR /&gt;
  pNewDB-&amp;gt;setThumbnailBitmap(pThumbnail);&lt;BR /&gt;
&lt;BR /&gt;
The documentation is not very clear (or extensive) so i'm not sure i do the&lt;BR /&gt;
right thing&lt;BR /&gt;
TIA&lt;BR /&gt;
&lt;BR /&gt;
alex&lt;/ALEXB&gt;&lt;/ARTC&gt;&lt;/ALEXB&gt;</description>
      <pubDate>Thu, 20 Apr 2006 04:49:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/generate-preview/m-p/1616839#M23833</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-04-20T04:49:16Z</dc:date>
    </item>
    <item>
      <title>Re: Generate preview</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/generate-preview/m-p/1616840#M23834</link>
      <description>The logical conclusion for me is&lt;BR /&gt;
not create a database before wblock but&lt;BR /&gt;
let your function do all what the user makes with the drawing...&lt;BR /&gt;
- to create a new document&lt;BR /&gt;
- wblock the wished entities from source document&lt;BR /&gt;
- set document to current (or active?)&lt;BR /&gt;
- zoom (all or limits), optionally shade the dwg&lt;BR /&gt;
- and save the dwg temporary&lt;BR /&gt;
&lt;BR /&gt;
But the programmer not wish a mdi child, which popups in the meantime.&lt;BR /&gt;
Here ends my hope to find a nice (acceptable) solution.&lt;BR /&gt;
&lt;BR /&gt;
doc snyder&lt;BR /&gt;
&lt;BR /&gt;
"Art Cooney" &lt;ARTC&gt; schrieb im Newsbeitrag news:5148272@discussion.autodesk.com...&lt;BR /&gt;
If you're aware that it returns NULL, then what do you mean by it "fails"?&lt;BR /&gt;
&lt;BR /&gt;
There isn't any way to get wblock to create a thumbnail.  The thumbnail is&lt;BR /&gt;
generated by our graphics system and requires that the drawing be loaded in&lt;BR /&gt;
the AutoCAD editor.  The only way to get AutoCAD to put a thumbnail in the&lt;BR /&gt;
drawing created by the wblock would be to open that drawing in the AutoCAD&lt;BR /&gt;
editor and then save it.&lt;BR /&gt;
&lt;BR /&gt;
"alex" &lt;ALEXB&gt; wrote in message&lt;BR /&gt;
news:5148244@discussion.autodesk.com...&lt;BR /&gt;
Art:&lt;BR /&gt;
It indeed returns NULL.&lt;BR /&gt;
I am aware of the fact that wblock() doesn't create thumbnails, i'm just&lt;BR /&gt;
looking for a way around it.&lt;BR /&gt;
thanks&lt;BR /&gt;
&lt;BR /&gt;
alex&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
"Art Cooney" &lt;ARTC&gt; wrote in message&lt;BR /&gt;
news:5147493@discussion.autodesk.com...&lt;BR /&gt;
How is it failing?&lt;BR /&gt;
&lt;BR /&gt;
wblock() won't create a thumbnail in the database it is writing to, so&lt;BR /&gt;
pNewDB-&amp;gt;thumbnailBitmap() should return NULL.&lt;BR /&gt;
&lt;BR /&gt;
"alex" &lt;ALEXB&gt; wrote in message&lt;BR /&gt;
news:5146780@discussion.autodesk.com...&lt;BR /&gt;
Hi,&lt;BR /&gt;
&lt;BR /&gt;
I'm trying using AcDbDatabase::thumbnailBitmap() and&lt;BR /&gt;
AcDbDatabase::setThumbnailBitmap()&lt;BR /&gt;
to generate a preview thumbnail on a new database before saving it, but it&lt;BR /&gt;
fails on thumbnailBitmap().&lt;BR /&gt;
&lt;BR /&gt;
Here is the code: (ObjectArx2002), no error checking&lt;BR /&gt;
&lt;BR /&gt;
  AcDbDatabase *pNewDB = NULL;//new database;&lt;BR /&gt;
  es = acdbHostApplicationServices()-&amp;gt;workingDatabase()-&amp;gt;wblock(pNewDB,&lt;BR /&gt;
id);//add something to it&lt;BR /&gt;
  void * pThumbnail = pNewDB-&amp;gt;thumbnailBitmap();//fails here&lt;BR /&gt;
  pNewDB-&amp;gt;setThumbnailBitmap(pThumbnail);&lt;BR /&gt;
&lt;BR /&gt;
The documentation is not very clear (or extensive) so i'm not sure i do the&lt;BR /&gt;
right thing&lt;BR /&gt;
TIA&lt;BR /&gt;
&lt;BR /&gt;
alex&lt;/ALEXB&gt;&lt;/ARTC&gt;&lt;/ALEXB&gt;&lt;/ARTC&gt;</description>
      <pubDate>Thu, 20 Apr 2006 06:09:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/generate-preview/m-p/1616840#M23834</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-04-20T06:09:22Z</dc:date>
    </item>
    <item>
      <title>Re: Generate preview</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/generate-preview/m-p/1616841#M23835</link>
      <description>typedef Acad::ErrorStatus&lt;BR /&gt;
  (*acdbMakeDrawingPreviewPtr)&lt;BR /&gt;
    (AcDbDatabase* pDb, bool bUnused);&lt;BR /&gt;
&lt;BR /&gt;
Acad::ErrorStatus MakeThumbnail(AcDbDatabase* pDb)&lt;BR /&gt;
{&lt;BR /&gt;
   static acdbMakeDrawingPreviewPtr pFunc = NULL;&lt;BR /&gt;
   if( pFunc == NULL )&lt;BR /&gt;
   {&lt;BR /&gt;
      HMODULE hLib = GetArxModuleHandle("AcBlock.arx");&lt;BR /&gt;
      if( hLib == NULL )&lt;BR /&gt;
         return Acad::eInvalidInput;&lt;BR /&gt;
      void* pv = ::GetProcAddress(hLib,&lt;BR /&gt;
                      "acdbMakeDrawingPreview");&lt;BR /&gt;
      if( pv == NULL )&lt;BR /&gt;
         return Acad::eInvalidInput;&lt;BR /&gt;
      pFunc = (acdbMakeDrawingPreviewPtr) pv;&lt;BR /&gt;
   }&lt;BR /&gt;
   if( pDb == NULL )&lt;BR /&gt;
      return Acad::eInvalidInput;&lt;BR /&gt;
   return (*pFunc)(pDb, false);&lt;BR /&gt;
}&lt;BR /&gt;
&lt;BR /&gt;
// moduleName (filename.arx) must be on PATH.&lt;BR /&gt;
&lt;BR /&gt;
HMODULE GetArxModuleHandle(const char* moduleName)&lt;BR /&gt;
{&lt;BR /&gt;
   HMODULE hLib = ::GetModuleHandle(moduleName);&lt;BR /&gt;
   if( hLib == NULL )&lt;BR /&gt;
   {&lt;BR /&gt;
      acrxLoadModule(moduleName, false, false);&lt;BR /&gt;
      hLib = ::GetModuleHandle(moduleName);&lt;BR /&gt;
   }&lt;BR /&gt;
   return hLib;&lt;BR /&gt;
}&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006/2007&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
"alex" &lt;ALEXB&gt; wrote in message news:5148244@discussion.autodesk.com...&lt;BR /&gt;
Art:&lt;BR /&gt;
It indeed returns NULL.&lt;BR /&gt;
I am aware of the fact that wblock() doesn't create thumbnails, i'm just&lt;BR /&gt;
looking for a way around it.&lt;BR /&gt;
thanks&lt;BR /&gt;
&lt;BR /&gt;
alex&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
"Art Cooney" &lt;ARTC&gt; wrote in message&lt;BR /&gt;
news:5147493@discussion.autodesk.com...&lt;BR /&gt;
How is it failing?&lt;BR /&gt;
&lt;BR /&gt;
wblock() won't create a thumbnail in the database it is writing to, so&lt;BR /&gt;
pNewDB-&amp;gt;thumbnailBitmap() should return NULL.&lt;BR /&gt;
&lt;BR /&gt;
"alex" &lt;ALEXB&gt; wrote in message&lt;BR /&gt;
news:5146780@discussion.autodesk.com...&lt;BR /&gt;
Hi,&lt;BR /&gt;
&lt;BR /&gt;
I'm trying using AcDbDatabase::thumbnailBitmap() and&lt;BR /&gt;
AcDbDatabase::setThumbnailBitmap()&lt;BR /&gt;
to generate a preview thumbnail on a new database before saving it, but it&lt;BR /&gt;
fails on thumbnailBitmap().&lt;BR /&gt;
&lt;BR /&gt;
Here is the code: (ObjectArx2002), no error checking&lt;BR /&gt;
&lt;BR /&gt;
  AcDbDatabase *pNewDB = NULL;//new database;&lt;BR /&gt;
  es = acdbHostApplicationServices()-&amp;gt;workingDatabase()-&amp;gt;wblock(pNewDB,&lt;BR /&gt;
id);//add something to it&lt;BR /&gt;
  void * pThumbnail = pNewDB-&amp;gt;thumbnailBitmap();//fails here&lt;BR /&gt;
  pNewDB-&amp;gt;setThumbnailBitmap(pThumbnail);&lt;BR /&gt;
&lt;BR /&gt;
The documentation is not very clear (or extensive) so i'm not sure i do the&lt;BR /&gt;
right thing&lt;BR /&gt;
TIA&lt;BR /&gt;
&lt;BR /&gt;
alex&lt;/ALEXB&gt;&lt;/ARTC&gt;&lt;/ALEXB&gt;</description>
      <pubDate>Thu, 20 Apr 2006 16:56:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/generate-preview/m-p/1616841#M23835</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-04-20T16:56:25Z</dc:date>
    </item>
    <item>
      <title>Re: Generate preview</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/generate-preview/m-p/1616842#M23836</link>
      <description>Art:&lt;BR /&gt;
I just meant it fails for me. I didn't understand it works just for the&lt;BR /&gt;
current db.&lt;BR /&gt;
Do you have any comment to Tony's post of today?&lt;BR /&gt;
&lt;BR /&gt;
Thanks,&lt;BR /&gt;
&lt;BR /&gt;
alex&lt;BR /&gt;
&lt;BR /&gt;
"Art Cooney" &lt;ARTC&gt; wrote in message&lt;BR /&gt;
news:5148272@discussion.autodesk.com...&lt;BR /&gt;
If you're aware that it returns NULL, then what do you mean by it "fails"?&lt;BR /&gt;
&lt;BR /&gt;
There isn't any way to get wblock to create a thumbnail.  The thumbnail is&lt;BR /&gt;
generated by our graphics system and requires that the drawing be loaded in&lt;BR /&gt;
the AutoCAD editor.  The only way to get AutoCAD to put a thumbnail in the&lt;BR /&gt;
drawing created by the wblock would be to open that drawing in the AutoCAD&lt;BR /&gt;
editor and then save it.&lt;BR /&gt;
&lt;BR /&gt;
"alex" &lt;ALEXB&gt; wrote in message&lt;BR /&gt;
news:5148244@discussion.autodesk.com...&lt;BR /&gt;
Art:&lt;BR /&gt;
It indeed returns NULL.&lt;BR /&gt;
I am aware of the fact that wblock() doesn't create thumbnails, i'm just&lt;BR /&gt;
looking for a way around it.&lt;BR /&gt;
thanks&lt;BR /&gt;
&lt;BR /&gt;
alex&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
"Art Cooney" &lt;ARTC&gt; wrote in message&lt;BR /&gt;
news:5147493@discussion.autodesk.com...&lt;BR /&gt;
How is it failing?&lt;BR /&gt;
&lt;BR /&gt;
wblock() won't create a thumbnail in the database it is writing to, so&lt;BR /&gt;
pNewDB-&amp;gt;thumbnailBitmap() should return NULL.&lt;BR /&gt;
&lt;BR /&gt;
"alex" &lt;ALEXB&gt; wrote in message&lt;BR /&gt;
news:5146780@discussion.autodesk.com...&lt;BR /&gt;
Hi,&lt;BR /&gt;
&lt;BR /&gt;
I'm trying using AcDbDatabase::thumbnailBitmap() and&lt;BR /&gt;
AcDbDatabase::setThumbnailBitmap()&lt;BR /&gt;
to generate a preview thumbnail on a new database before saving it, but it&lt;BR /&gt;
fails on thumbnailBitmap().&lt;BR /&gt;
&lt;BR /&gt;
Here is the code: (ObjectArx2002), no error checking&lt;BR /&gt;
&lt;BR /&gt;
  AcDbDatabase *pNewDB = NULL;//new database;&lt;BR /&gt;
  es = acdbHostApplicationServices()-&amp;gt;workingDatabase()-&amp;gt;wblock(pNewDB,&lt;BR /&gt;
id);//add something to it&lt;BR /&gt;
  void * pThumbnail = pNewDB-&amp;gt;thumbnailBitmap();//fails here&lt;BR /&gt;
  pNewDB-&amp;gt;setThumbnailBitmap(pThumbnail);&lt;BR /&gt;
&lt;BR /&gt;
The documentation is not very clear (or extensive) so i'm not sure i do the&lt;BR /&gt;
right thing&lt;BR /&gt;
TIA&lt;BR /&gt;
&lt;BR /&gt;
alex&lt;/ALEXB&gt;&lt;/ARTC&gt;&lt;/ALEXB&gt;&lt;/ARTC&gt;</description>
      <pubDate>Thu, 20 Apr 2006 17:06:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/generate-preview/m-p/1616842#M23836</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-04-20T17:06:28Z</dc:date>
    </item>
    <item>
      <title>Re: Generate preview</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/generate-preview/m-p/1616843#M23837</link>
      <description>Tony:&lt;BR /&gt;
&lt;BR /&gt;
Just what i was looking for.&lt;BR /&gt;
If I understand you right, it's a (undocumented?) function exported by&lt;BR /&gt;
AcBlock.arx&lt;BR /&gt;
I just tried it on a ACAD2000, works OK. It looks just like what wblock&lt;BR /&gt;
command does - thumbnailwise, including 'low quality' thumbnail.&lt;BR /&gt;
It seems the GS has to 'see' it on the screen to do it right.&lt;BR /&gt;
Does it work in 2006, 2007?.&lt;BR /&gt;
&lt;BR /&gt;
Thanks&lt;BR /&gt;
&lt;BR /&gt;
alex&lt;BR /&gt;
&lt;BR /&gt;
"Tony Tanzillo" &lt;TONY.TANZILLO&gt; wrote in message&lt;BR /&gt;
news:5149046@discussion.autodesk.com...&lt;BR /&gt;
typedef Acad::ErrorStatus&lt;BR /&gt;
  (*acdbMakeDrawingPreviewPtr)&lt;BR /&gt;
    (AcDbDatabase* pDb, bool bUnused);&lt;BR /&gt;
&lt;BR /&gt;
Acad::ErrorStatus MakeThumbnail(AcDbDatabase* pDb)&lt;BR /&gt;
{&lt;BR /&gt;
   static acdbMakeDrawingPreviewPtr pFunc = NULL;&lt;BR /&gt;
   if( pFunc == NULL )&lt;BR /&gt;
   {&lt;BR /&gt;
      HMODULE hLib = GetArxModuleHandle("AcBlock.arx");&lt;BR /&gt;
      if( hLib == NULL )&lt;BR /&gt;
         return Acad::eInvalidInput;&lt;BR /&gt;
      void* pv = ::GetProcAddress(hLib,&lt;BR /&gt;
                      "acdbMakeDrawingPreview");&lt;BR /&gt;
      if( pv == NULL )&lt;BR /&gt;
         return Acad::eInvalidInput;&lt;BR /&gt;
      pFunc = (acdbMakeDrawingPreviewPtr) pv;&lt;BR /&gt;
   }&lt;BR /&gt;
   if( pDb == NULL )&lt;BR /&gt;
      return Acad::eInvalidInput;&lt;BR /&gt;
   return (*pFunc)(pDb, false);&lt;BR /&gt;
}&lt;BR /&gt;
&lt;BR /&gt;
// moduleName (filename.arx) must be on PATH.&lt;BR /&gt;
&lt;BR /&gt;
HMODULE GetArxModuleHandle(const char* moduleName)&lt;BR /&gt;
{&lt;BR /&gt;
   HMODULE hLib = ::GetModuleHandle(moduleName);&lt;BR /&gt;
   if( hLib == NULL )&lt;BR /&gt;
   {&lt;BR /&gt;
      acrxLoadModule(moduleName, false, false);&lt;BR /&gt;
      hLib = ::GetModuleHandle(moduleName);&lt;BR /&gt;
   }&lt;BR /&gt;
   return hLib;&lt;BR /&gt;
}&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
--&lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006/2007&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
"alex" &lt;ALEXB&gt; wrote in message&lt;BR /&gt;
news:5148244@discussion.autodesk.com...&lt;BR /&gt;
Art:&lt;BR /&gt;
It indeed returns NULL.&lt;BR /&gt;
I am aware of the fact that wblock() doesn't create thumbnails, i'm just&lt;BR /&gt;
looking for a way around it.&lt;BR /&gt;
thanks&lt;BR /&gt;
&lt;BR /&gt;
alex&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
"Art Cooney" &lt;ARTC&gt; wrote in message&lt;BR /&gt;
news:5147493@discussion.autodesk.com...&lt;BR /&gt;
How is it failing?&lt;BR /&gt;
&lt;BR /&gt;
wblock() won't create a thumbnail in the database it is writing to, so&lt;BR /&gt;
pNewDB-&amp;gt;thumbnailBitmap() should return NULL.&lt;BR /&gt;
&lt;BR /&gt;
"alex" &lt;ALEXB&gt; wrote in message&lt;BR /&gt;
news:5146780@discussion.autodesk.com...&lt;BR /&gt;
Hi,&lt;BR /&gt;
&lt;BR /&gt;
I'm trying using AcDbDatabase::thumbnailBitmap() and&lt;BR /&gt;
AcDbDatabase::setThumbnailBitmap()&lt;BR /&gt;
to generate a preview thumbnail on a new database before saving it, but it&lt;BR /&gt;
fails on thumbnailBitmap().&lt;BR /&gt;
&lt;BR /&gt;
Here is the code: (ObjectArx2002), no error checking&lt;BR /&gt;
&lt;BR /&gt;
  AcDbDatabase *pNewDB = NULL;//new database;&lt;BR /&gt;
  es = acdbHostApplicationServices()-&amp;gt;workingDatabase()-&amp;gt;wblock(pNewDB,&lt;BR /&gt;
id);//add something to it&lt;BR /&gt;
  void * pThumbnail = pNewDB-&amp;gt;thumbnailBitmap();//fails here&lt;BR /&gt;
  pNewDB-&amp;gt;setThumbnailBitmap(pThumbnail);&lt;BR /&gt;
&lt;BR /&gt;
The documentation is not very clear (or extensive) so i'm not sure i do the&lt;BR /&gt;
right thing&lt;BR /&gt;
TIA&lt;BR /&gt;
&lt;BR /&gt;
alex&lt;/ALEXB&gt;&lt;/ARTC&gt;&lt;/ALEXB&gt;&lt;/TONY.TANZILLO&gt;</description>
      <pubDate>Thu, 20 Apr 2006 17:20:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/generate-preview/m-p/1616843#M23837</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-04-20T17:20:03Z</dc:date>
    </item>
    <item>
      <title>Re: Generate preview</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/generate-preview/m-p/1616844#M23838</link>
      <description>All that I can say is use undocumented functions at your own risk because &lt;BR /&gt;
they can change or go away.&lt;BR /&gt;
&lt;BR /&gt;
"alex" &lt;ALEXB&gt; wrote in message &lt;BR /&gt;
news:5149048@discussion.autodesk.com...&lt;BR /&gt;
Art:&lt;BR /&gt;
I just meant it fails for me. I didn't understand it works just for the&lt;BR /&gt;
current db.&lt;BR /&gt;
Do you have any comment to Tony's post of today?&lt;BR /&gt;
&lt;BR /&gt;
Thanks,&lt;BR /&gt;
&lt;BR /&gt;
alex&lt;BR /&gt;
&lt;BR /&gt;
"Art Cooney" &lt;ARTC&gt; wrote in message&lt;BR /&gt;
news:5148272@discussion.autodesk.com...&lt;BR /&gt;
If you're aware that it returns NULL, then what do you mean by it "fails"?&lt;BR /&gt;
&lt;BR /&gt;
There isn't any way to get wblock to create a thumbnail.  The thumbnail is&lt;BR /&gt;
generated by our graphics system and requires that the drawing be loaded in&lt;BR /&gt;
the AutoCAD editor.  The only way to get AutoCAD to put a thumbnail in the&lt;BR /&gt;
drawing created by the wblock would be to open that drawing in the AutoCAD&lt;BR /&gt;
editor and then save it.&lt;BR /&gt;
&lt;BR /&gt;
"alex" &lt;ALEXB&gt; wrote in message&lt;BR /&gt;
news:5148244@discussion.autodesk.com...&lt;BR /&gt;
Art:&lt;BR /&gt;
It indeed returns NULL.&lt;BR /&gt;
I am aware of the fact that wblock() doesn't create thumbnails, i'm just&lt;BR /&gt;
looking for a way around it.&lt;BR /&gt;
thanks&lt;BR /&gt;
&lt;BR /&gt;
alex&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
"Art Cooney" &lt;ARTC&gt; wrote in message&lt;BR /&gt;
news:5147493@discussion.autodesk.com...&lt;BR /&gt;
How is it failing?&lt;BR /&gt;
&lt;BR /&gt;
wblock() won't create a thumbnail in the database it is writing to, so&lt;BR /&gt;
pNewDB-&amp;gt;thumbnailBitmap() should return NULL.&lt;BR /&gt;
&lt;BR /&gt;
"alex" &lt;ALEXB&gt; wrote in message&lt;BR /&gt;
news:5146780@discussion.autodesk.com...&lt;BR /&gt;
Hi,&lt;BR /&gt;
&lt;BR /&gt;
I'm trying using AcDbDatabase::thumbnailBitmap() and&lt;BR /&gt;
AcDbDatabase::setThumbnailBitmap()&lt;BR /&gt;
to generate a preview thumbnail on a new database before saving it, but it&lt;BR /&gt;
fails on thumbnailBitmap().&lt;BR /&gt;
&lt;BR /&gt;
Here is the code: (ObjectArx2002), no error checking&lt;BR /&gt;
&lt;BR /&gt;
  AcDbDatabase *pNewDB = NULL;//new database;&lt;BR /&gt;
  es = acdbHostApplicationServices()-&amp;gt;workingDatabase()-&amp;gt;wblock(pNewDB,&lt;BR /&gt;
id);//add something to it&lt;BR /&gt;
  void * pThumbnail = pNewDB-&amp;gt;thumbnailBitmap();//fails here&lt;BR /&gt;
  pNewDB-&amp;gt;setThumbnailBitmap(pThumbnail);&lt;BR /&gt;
&lt;BR /&gt;
The documentation is not very clear (or extensive) so i'm not sure i do the&lt;BR /&gt;
right thing&lt;BR /&gt;
TIA&lt;BR /&gt;
&lt;BR /&gt;
alex&lt;/ALEXB&gt;&lt;/ARTC&gt;&lt;/ALEXB&gt;&lt;/ARTC&gt;&lt;/ALEXB&gt;</description>
      <pubDate>Thu, 20 Apr 2006 20:15:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/generate-preview/m-p/1616844#M23838</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-04-20T20:15:42Z</dc:date>
    </item>
    <item>
      <title>Re: Generate preview</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/generate-preview/m-p/1616845#M23839</link>
      <description>"Art Cooney" &lt;ARTC&gt; wrote &lt;BR /&gt;
&lt;BR /&gt;
&amp;gt;&amp;gt; All that I can say is use undocumented functions &lt;BR /&gt;
&amp;gt;&amp;gt; at your own risk because they can change or go away.&lt;BR /&gt;
&lt;BR /&gt;
Perhaps one reason we tend to rely on undocumented&lt;BR /&gt;
APIs is because the above statement seems to apply&lt;BR /&gt;
to documented APIs and their behavior as well.&lt;BR /&gt;
&lt;BR /&gt;
For example, the way selection set ordering changed&lt;BR /&gt;
in 2005, broke thousands of scripts that relied on the&lt;BR /&gt;
previous behavior (selection set order == picked order).&lt;BR /&gt;
&lt;BR /&gt;
IOW, when it comes to having the rug yanked out from &lt;BR /&gt;
beneath us, it does not seem to matter much if it was &lt;BR /&gt;
documented, or not.&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006/2007&lt;BR /&gt;
http://www.acadxtabs.com&lt;/ARTC&gt;</description>
      <pubDate>Thu, 20 Apr 2006 20:54:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/generate-preview/m-p/1616845#M23839</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-04-20T20:54:28Z</dc:date>
    </item>
  </channel>
</rss>

