<?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: Generating Tool Image for Block Reference (C# .NET) in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/generating-tool-image-for-block-reference-c-net/m-p/10279240#M16562</link>
    <description>&lt;P&gt;You can use Autodesk.AutoCAD.Internal.Utils.GetBlockImage() method to acquire an image by passing a block definition's ObjectId (not a BlockReference!). The block definition can be from a opened document, or a side database (that is, you do not have to open the drawing into AutoCAD editor in order to do it).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;See one of my recent articles on this topic:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://drive-cad-with-code.blogspot.com/2020/12/obtaining-blocks-image.html" target="_self"&gt;https://drive-cad-with-code.blogspot.com/2020/12/obtaining-blocks-image.html&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 29 Apr 2021 17:36:05 GMT</pubDate>
    <dc:creator>norman.yuan</dc:creator>
    <dc:date>2021-04-29T17:36:05Z</dc:date>
    <item>
      <title>Generating Tool Image for Block Reference (C# .NET)</title>
      <link>https://forums.autodesk.com/t5/net-forum/generating-tool-image-for-block-reference-c-net/m-p/10279103#M16561</link>
      <description>&lt;P&gt;been developing a tool to generate new tool palettes that contain block references. The tool palettes generate and are populated with the block references, however the tool images show as plain white. Is there a way I can generate these images through any available API?&lt;span class="lia-inline-image-display-wrapper lia-image-align-right" image-alt="Screenshot 2021-04-29 174515.jpg" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/913390i50C3A30022C42AB5/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2021-04-29 174515.jpg" alt="Screenshot 2021-04-29 174515.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Apr 2021 16:50:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/generating-tool-image-for-block-reference-c-net/m-p/10279103#M16561</guid>
      <dc:creator>Tom_Fuller</dc:creator>
      <dc:date>2021-04-29T16:50:05Z</dc:date>
    </item>
    <item>
      <title>Re: Generating Tool Image for Block Reference (C# .NET)</title>
      <link>https://forums.autodesk.com/t5/net-forum/generating-tool-image-for-block-reference-c-net/m-p/10279240#M16562</link>
      <description>&lt;P&gt;You can use Autodesk.AutoCAD.Internal.Utils.GetBlockImage() method to acquire an image by passing a block definition's ObjectId (not a BlockReference!). The block definition can be from a opened document, or a side database (that is, you do not have to open the drawing into AutoCAD editor in order to do it).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;See one of my recent articles on this topic:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://drive-cad-with-code.blogspot.com/2020/12/obtaining-blocks-image.html" target="_self"&gt;https://drive-cad-with-code.blogspot.com/2020/12/obtaining-blocks-image.html&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Apr 2021 17:36:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/generating-tool-image-for-block-reference-c-net/m-p/10279240#M16562</guid>
      <dc:creator>norman.yuan</dc:creator>
      <dc:date>2021-04-29T17:36:05Z</dc:date>
    </item>
    <item>
      <title>Re: Generating Tool Image for Block Reference (C# .NET)</title>
      <link>https://forums.autodesk.com/t5/net-forum/generating-tool-image-for-block-reference-c-net/m-p/10279382#M16563</link>
      <description>&lt;P&gt;&amp;nbsp;oops&lt;/P&gt;</description>
      <pubDate>Thu, 29 Apr 2021 18:25:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/generating-tool-image-for-block-reference-c-net/m-p/10279382#M16563</guid>
      <dc:creator>Tom_Fuller</dc:creator>
      <dc:date>2021-04-29T18:25:55Z</dc:date>
    </item>
    <item>
      <title>Re: Generating Tool Image for Block Reference (C# .NET)</title>
      <link>https://forums.autodesk.com/t5/net-forum/generating-tool-image-for-block-reference-c-net/m-p/10279390#M16564</link>
      <description>&lt;P&gt;That looks like the sort of thing I'm after! My only concern is how this will affect the attributes of the block. Some of the blocks use the same block definition and have their block attributes modified based on a dynamic property and a block properties table. Because of this, whenever that specific version of the block is added into the drawing,&amp;nbsp;it has an anonymous block... so if I wanted to capture the image with the correct attributes set, would I want to use the AnonymousBlockTableRecord found on the BlockReference object? I've attatched a couple of screenshots showing a 2 of the tools in the palette updated for reference, as well as the information for one of those inserted tools.&amp;nbsp; &amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-right" image-alt="4.jpg" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/913440iD793EA627ECD8F1B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="4.jpg" alt="4.jpg" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-right" image-alt="2.jpg" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/913422i0B3439AB21E16214/image-size/medium?v=v2&amp;amp;px=400" role="button" title="2.jpg" alt="2.jpg" /&gt;&lt;/span&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Apr 2021 18:24:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/generating-tool-image-for-block-reference-c-net/m-p/10279390#M16564</guid>
      <dc:creator>Tom_Fuller</dc:creator>
      <dc:date>2021-04-29T18:24:44Z</dc:date>
    </item>
    <item>
      <title>Re: Generating Tool Image for Block Reference (C# .NET)</title>
      <link>https://forums.autodesk.com/t5/net-forum/generating-tool-image-for-block-reference-c-net/m-p/10279394#M16565</link>
      <description>&lt;P&gt;Yes, you would also need to use the relevant anonymous block definitions in your described case.&lt;/P&gt;</description>
      <pubDate>Thu, 29 Apr 2021 18:25:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/generating-tool-image-for-block-reference-c-net/m-p/10279394#M16565</guid>
      <dc:creator>norman.yuan</dc:creator>
      <dc:date>2021-04-29T18:25:50Z</dc:date>
    </item>
    <item>
      <title>Re: Generating Tool Image for Block Reference (C# .NET)</title>
      <link>https://forums.autodesk.com/t5/net-forum/generating-tool-image-for-block-reference-c-net/m-p/10279411#M16566</link>
      <description>Awesome, I'll give it a go now and see how it goes &lt;span class="lia-unicode-emoji" title=":smiling_face_with_smiling_eyes:"&gt;😊&lt;/span&gt;</description>
      <pubDate>Thu, 29 Apr 2021 18:31:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/generating-tool-image-for-block-reference-c-net/m-p/10279411#M16566</guid>
      <dc:creator>Tom_Fuller</dc:creator>
      <dc:date>2021-04-29T18:31:31Z</dc:date>
    </item>
    <item>
      <title>Re: Generating Tool Image for Block Reference (C# .NET)</title>
      <link>https://forums.autodesk.com/t5/net-forum/generating-tool-image-for-block-reference-c-net/m-p/10279678#M16567</link>
      <description>&lt;P&gt;Ok, so it worked... kind of.&amp;nbsp; it produced images, but the attributes didn't show up, or they show up as the attribute names in some cases. This might be because I need to sync the attribute definitions with the attributes references, or the attributes are being clipped&amp;nbsp;by the size of the image (64x64). Is it possible to produce an image with a transparent background?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Apr 2021 20:06:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/generating-tool-image-for-block-reference-c-net/m-p/10279678#M16567</guid>
      <dc:creator>Tom_Fuller</dc:creator>
      <dc:date>2021-04-29T20:06:18Z</dc:date>
    </item>
  </channel>
</rss>

