<?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: Capture brand new thumbnail of DWG  on (side) database in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/capture-brand-new-thumbnail-of-dwg-on-side-database/m-p/11374663#M17396</link>
    <description>&lt;P&gt;You question inspired me to write some code that could be the solution for you. I post the code in my block here:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://drive-cad-with-code.blogspot.com/2022/08/generating-drawing-thumbnailpreview.html" target="_blank" rel="noopener"&gt;https://drive-cad-with-code.blogspot.com/2022/08/generating-drawing-thumbnailpreview.html&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope it helps.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 23 Aug 2022 03:39:01 GMT</pubDate>
    <dc:creator>Norman_Yuan</dc:creator>
    <dc:date>2022-08-23T03:39:01Z</dc:date>
    <item>
      <title>Capture brand new thumbnail of DWG  on (side) database</title>
      <link>https://forums.autodesk.com/t5/net-forum/capture-brand-new-thumbnail-of-dwg-on-side-database/m-p/10103404#M17392</link>
      <description>&lt;P&gt;Hi all,&lt;BR /&gt;i would like to use similar command without opening document&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;db.ThumbnailBitmap = doc.&lt;STRONG&gt;CapturePreviewImage&lt;/STRONG&gt;(height, width);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Did someone test this? or is it even possible?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Feb 2021 23:33:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/capture-brand-new-thumbnail-of-dwg-on-side-database/m-p/10103404#M17392</guid>
      <dc:creator>BestFriendCZ</dc:creator>
      <dc:date>2021-02-22T23:33:35Z</dc:date>
    </item>
    <item>
      <title>Re: Capture brand new thumbnail of DWG  on (side) database</title>
      <link>https://forums.autodesk.com/t5/net-forum/capture-brand-new-thumbnail-of-dwg-on-side-database/m-p/11372517#M17393</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;i would like to try update this question? Is there anybody who knows how to update document preview on database side (ReadDwgFile)?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there even possible (I spend some time on that and didn't find solution)?&lt;/P&gt;</description>
      <pubDate>Mon, 22 Aug 2022 06:47:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/capture-brand-new-thumbnail-of-dwg-on-side-database/m-p/11372517#M17393</guid>
      <dc:creator>BestFriendCZ</dc:creator>
      <dc:date>2022-08-22T06:47:31Z</dc:date>
    </item>
    <item>
      <title>Re: Capture brand new thumbnail of DWG  on (side) database</title>
      <link>https://forums.autodesk.com/t5/net-forum/capture-brand-new-thumbnail-of-dwg-on-side-database/m-p/11373758#M17394</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can get a DWG thumbnail from outide of AutoCAD.&lt;/P&gt;
&lt;P&gt;Code inspired by &lt;A href="http://www.theswamp.org/index.php?topic=30985.msg470910#msg470910" target="_blank" rel="noopener"&gt;this topic.&lt;/A&gt;&lt;/P&gt;
&lt;LI-CODE lang="csharp"&gt;        static Bitmap GetBitmap(string fileName)
        {
            using (FileStream fs = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
            using (BinaryReader br = new BinaryReader(fs))
            {
                fs.Seek(0xD, SeekOrigin.Begin);
                fs.Seek(0x14 + br.ReadInt32(), SeekOrigin.Begin);
                byte bytCnt = br.ReadByte();
                if (bytCnt &amp;lt;= 1)
                    return null;
                for (short i = 1; i &amp;lt;= bytCnt; i++)
                {
                    byte imageCode = br.ReadByte();
                    int imageHeaderStart = br.ReadInt32();
                    int imageHeaderSize = br.ReadInt32();
                    if (imageCode == 6)       //PNG Preview (2013 file format);
                    {
                        fs.Seek(imageHeaderStart, SeekOrigin.Begin);
                        using (var ms = new MemoryStream())
                        {
                            fs.CopyTo(ms, imageHeaderStart);
                            var img = Image.FromStream(ms);
                            return new Bitmap(img);
                        }
                    }
                }
            }
            return null;
        }&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 22 Aug 2022 16:49:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/capture-brand-new-thumbnail-of-dwg-on-side-database/m-p/11373758#M17394</guid>
      <dc:creator>_gile</dc:creator>
      <dc:date>2022-08-22T16:49:45Z</dc:date>
    </item>
    <item>
      <title>Re: Capture brand new thumbnail of DWG  on (side) database</title>
      <link>https://forums.autodesk.com/t5/net-forum/capture-brand-new-thumbnail-of-dwg-on-side-database/m-p/11373812#M17395</link>
      <description>&lt;P&gt;Hi _gile,&lt;/P&gt;&lt;P&gt;thank you for your feedback.&lt;/P&gt;&lt;P&gt;you are correct. Problem is that my question was not that specific ... sorry for that.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I know about this way how to read preview but i need capture brand new preview.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Situation like:&lt;/P&gt;&lt;P&gt;1) you do some changes on database side (changes which affect model)&lt;/P&gt;&lt;P&gt;2) and you need to create brand new thumbnail&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I didn’t find way hot to achieve without open in CAD.... so i don’t know if it is even possible&lt;/P&gt;</description>
      <pubDate>Mon, 22 Aug 2022 17:21:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/capture-brand-new-thumbnail-of-dwg-on-side-database/m-p/11373812#M17395</guid>
      <dc:creator>BestFriendCZ</dc:creator>
      <dc:date>2022-08-22T17:21:15Z</dc:date>
    </item>
    <item>
      <title>Re: Capture brand new thumbnail of DWG  on (side) database</title>
      <link>https://forums.autodesk.com/t5/net-forum/capture-brand-new-thumbnail-of-dwg-on-side-database/m-p/11374663#M17396</link>
      <description>&lt;P&gt;You question inspired me to write some code that could be the solution for you. I post the code in my block here:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://drive-cad-with-code.blogspot.com/2022/08/generating-drawing-thumbnailpreview.html" target="_blank" rel="noopener"&gt;https://drive-cad-with-code.blogspot.com/2022/08/generating-drawing-thumbnailpreview.html&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope it helps.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Aug 2022 03:39:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/capture-brand-new-thumbnail-of-dwg-on-side-database/m-p/11374663#M17396</guid>
      <dc:creator>Norman_Yuan</dc:creator>
      <dc:date>2022-08-23T03:39:01Z</dc:date>
    </item>
    <item>
      <title>Re: Capture brand new thumbnail of DWG  on (side) database</title>
      <link>https://forums.autodesk.com/t5/net-forum/capture-brand-new-thumbnail-of-dwg-on-side-database/m-p/11375015#M17397</link>
      <description>&lt;P&gt;Hi Norman,&lt;BR /&gt;this is exactly which i need it.&lt;BR /&gt;I spent lots of time trying to achieve something like that. Thank you&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Aug 2022 07:52:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/capture-brand-new-thumbnail-of-dwg-on-side-database/m-p/11375015#M17397</guid>
      <dc:creator>BestFriendCZ</dc:creator>
      <dc:date>2022-08-23T07:52:02Z</dc:date>
    </item>
  </channel>
</rss>

