<?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: Hatch patterns list and preview in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/hatch-patterns-list-and-preview/m-p/13250613#M1226</link>
    <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/15981823"&gt;@Anthony_PungitoreJFMRZ&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The EntryPoint used by Tony is correct for acad2024 &amp;amp; 2025&lt;/P&gt;&lt;P&gt;ie : "?acedHatchPalletteDialog@@YA_NPEB_W_NAEAPEA_W@Z"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;added:&amp;nbsp; I just checked my archive ; ac2012 used the same EntryPoint&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Dumpbin_acad2012_exe.txt  2025-01-09_09-39-43.jpg" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1452614i63851D97881742EE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Dumpbin_acad2012_exe.txt  2025-01-09_09-39-43.jpg" alt="Dumpbin_acad2012_exe.txt  2025-01-09_09-39-43.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;but is the different to the sample as shown in Kean's 2007 blog post&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.keanw.com/2007/03/showing_autocad.html" target="_blank" rel="noopener"&gt;https://www.keanw.com/2007/03/showing_autocad.html&amp;nbsp;&lt;/A&gt;&amp;nbsp; &amp;nbsp; which is a different link than the OP's&lt;/P&gt;</description>
    <pubDate>Wed, 08 Jan 2025 20:57:40 GMT</pubDate>
    <dc:creator>kerry_w_brown</dc:creator>
    <dc:date>2025-01-08T20:57:40Z</dc:date>
    <item>
      <title>Hatch patterns list and preview</title>
      <link>https://forums.autodesk.com/t5/net-forum/hatch-patterns-list-and-preview/m-p/13249530#M1223</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I need to recreate the hatch pattern dialog (see screen cap below), since it seems it is not exposed by the API, and the solution suggested &lt;A href="https://www.keanw.com/2007/03/showing_autocad.html" target="_blank" rel="noopener"&gt;here&lt;/A&gt; does not seem to work anymore.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jptallano_0-1736337369369.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1452380i14A8C9BB6C554064/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jptallano_0-1736337369369.png" alt="jptallano_0-1736337369369.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I list existing patterns, and given a hatch pattern name, is it possible to retrieve its preview image?&lt;/P&gt;&lt;P&gt;For listing, I found &lt;A href="https://through-the-interface.typepad.com/through_the_interface/2012/03/getting-the-list-of-hatch-patterns-available-in-the-current-autocad-drawing-using-net.html" target="_blank" rel="noopener"&gt;this post&lt;/A&gt;, but can't get the solution to work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jan 2025 12:10:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/hatch-patterns-list-and-preview/m-p/13249530#M1223</guid>
      <dc:creator>jptallano</dc:creator>
      <dc:date>2025-01-08T12:10:20Z</dc:date>
    </item>
    <item>
      <title>Re: Hatch patterns list and preview</title>
      <link>https://forums.autodesk.com/t5/net-forum/hatch-patterns-list-and-preview/m-p/13250339#M1224</link>
      <description>&lt;P&gt;The solution you referenced is most-likely pre-unicode, and that might explain why it doesn't work, but this should work:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;public static class Class1
{
   /// &amp;lt;summary&amp;gt;
   /// List the names of all patterns
   /// &amp;lt;/summary&amp;gt;
   [CommandMethod("LISTPATTERNS")]
   public static void ListPatterns()
   {
      var ed = Application.DocumentManager.MdiActiveDocument.Editor;
      var names = HatchPatterns.Instance.AllPatterns.ToList();
      foreach(var item in names)
      {
         ed.WriteMessage($"\n{item}");
      }
   }

   /// &amp;lt;summary&amp;gt;
   /// Select a pattern using the UI:
   /// &amp;lt;/summary&amp;gt;
   [CommandMethod("HATCHPAL")]
   public static void HatchPalletteTest()
   {
      string name = "ANSI32";
      bool result = acedHatchPalletteDialog(name, false, out string output);
      if(result)
      {
         Application.DocumentManager.MdiActiveDocument
            .Editor.WriteMessage($"\nSelected {output}");
      }
   }

   [DllImport("acad.exe", CallingConvention = CallingConvention.Cdecl,
      CharSet = CharSet.Unicode,
      EntryPoint = "?acedHatchPalletteDialog@@YA_NPEB_W_NAEAPEA_W@Z")]
   public static extern bool acedHatchPalletteDialog(string pattern, bool allowCustom, out string result);
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jan 2025 18:48:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/hatch-patterns-list-and-preview/m-p/13250339#M1224</guid>
      <dc:creator>ActivistInvestor</dc:creator>
      <dc:date>2025-01-08T18:48:57Z</dc:date>
    </item>
    <item>
      <title>Re: Hatch patterns list and preview</title>
      <link>https://forums.autodesk.com/t5/net-forum/hatch-patterns-list-and-preview/m-p/13250415#M1225</link>
      <description>&lt;P&gt;His link to the original code was fine.&amp;nbsp; The real answer is that these EntryPoints are unmanaged native references that seem to always change with new software versions.&amp;nbsp; They aren't a documented part of the API.&amp;nbsp; You need to use the Visual Studio Dev Command Prompt and get it through bash with dumpbin on the acad.exe.&amp;nbsp; (dumpbin /exports &lt;SPAN class=""&gt;"C:\Program Files\Autodesk\AutoCAD 2024\acad.exe")&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jan 2025 19:05:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/hatch-patterns-list-and-preview/m-p/13250415#M1225</guid>
      <dc:creator>Anthony_PungitoreJFMRZ</dc:creator>
      <dc:date>2025-01-08T19:05:16Z</dc:date>
    </item>
    <item>
      <title>Re: Hatch patterns list and preview</title>
      <link>https://forums.autodesk.com/t5/net-forum/hatch-patterns-list-and-preview/m-p/13250613#M1226</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/15981823"&gt;@Anthony_PungitoreJFMRZ&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The EntryPoint used by Tony is correct for acad2024 &amp;amp; 2025&lt;/P&gt;&lt;P&gt;ie : "?acedHatchPalletteDialog@@YA_NPEB_W_NAEAPEA_W@Z"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;added:&amp;nbsp; I just checked my archive ; ac2012 used the same EntryPoint&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Dumpbin_acad2012_exe.txt  2025-01-09_09-39-43.jpg" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1452614i63851D97881742EE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Dumpbin_acad2012_exe.txt  2025-01-09_09-39-43.jpg" alt="Dumpbin_acad2012_exe.txt  2025-01-09_09-39-43.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;but is the different to the sample as shown in Kean's 2007 blog post&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.keanw.com/2007/03/showing_autocad.html" target="_blank" rel="noopener"&gt;https://www.keanw.com/2007/03/showing_autocad.html&amp;nbsp;&lt;/A&gt;&amp;nbsp; &amp;nbsp; which is a different link than the OP's&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jan 2025 20:57:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/hatch-patterns-list-and-preview/m-p/13250613#M1226</guid>
      <dc:creator>kerry_w_brown</dc:creator>
      <dc:date>2025-01-08T20:57:40Z</dc:date>
    </item>
    <item>
      <title>Re: Hatch patterns list and preview</title>
      <link>https://forums.autodesk.com/t5/net-forum/hatch-patterns-list-and-preview/m-p/13250641#M1227</link>
      <description>&lt;P&gt;Absolutely.&amp;nbsp; I was just trying to provide some inside that will help others find EntryPoints in future releases.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jan 2025 20:45:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/hatch-patterns-list-and-preview/m-p/13250641#M1227</guid>
      <dc:creator>Anthony_PungitoreJFMRZ</dc:creator>
      <dc:date>2025-01-08T20:45:17Z</dc:date>
    </item>
    <item>
      <title>Re: Hatch patterns list and preview</title>
      <link>https://forums.autodesk.com/t5/net-forum/hatch-patterns-list-and-preview/m-p/13250746#M1228</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/15981823"&gt;@Anthony_PungitoreJFMRZ&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;His link to the original code was fine.&amp;nbsp;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;The link to the original code is only fine if the OP is using AutoCAD 2007.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Entry point symbols do not change with each release. They are dependent on the platform (32/64 bit), and on whether the release is UNICODE or not, which changed between 2007 and 2008. AutoCAD 2008 was the first release to support 64 bit platforms natively, and AutoCAD 2020 was the last release to support 32 bit builds, so the "real answer" depends on what release and platform the OP is using.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Most use DependencyWalker (depends.exe) or its &lt;A href="https://github.com/lucasg/Dependencies" target="_blank" rel="noopener"&gt;managed cousin&lt;/A&gt; for examining export symbols.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jan 2025 21:52:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/hatch-patterns-list-and-preview/m-p/13250746#M1228</guid>
      <dc:creator>ActivistInvestor</dc:creator>
      <dc:date>2025-01-08T21:52:57Z</dc:date>
    </item>
    <item>
      <title>Re: Hatch patterns list and preview</title>
      <link>https://forums.autodesk.com/t5/net-forum/hatch-patterns-list-and-preview/m-p/13250769#M1229</link>
      <description>&lt;P&gt;That's definitely good to know, thank you.&amp;nbsp; No offense intended, when I said "real answer" I only meant to point out that the most important part of the code is the bit that is undocumented, and explaining the process on how to get these EntryPoints.&amp;nbsp; Everything else is basic API stuff.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jan 2025 22:10:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/hatch-patterns-list-and-preview/m-p/13250769#M1229</guid>
      <dc:creator>Anthony_PungitoreJFMRZ</dc:creator>
      <dc:date>2025-01-08T22:10:57Z</dc:date>
    </item>
    <item>
      <title>Re: Hatch patterns list and preview</title>
      <link>https://forums.autodesk.com/t5/net-forum/hatch-patterns-list-and-preview/m-p/13250857#M1230</link>
      <description>Yes, the api entry points are not documented because the apis themselves are not documented and subject to change or removal at any time.&lt;BR /&gt;&lt;BR /&gt;So one is always taking a risk by the depending on them.</description>
      <pubDate>Wed, 08 Jan 2025 23:07:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/hatch-patterns-list-and-preview/m-p/13250857#M1230</guid>
      <dc:creator>ActivistInvestor</dc:creator>
      <dc:date>2025-01-08T23:07:25Z</dc:date>
    </item>
    <item>
      <title>Re: Hatch patterns list and preview</title>
      <link>https://forums.autodesk.com/t5/net-forum/hatch-patterns-list-and-preview/m-p/13251004#M1231</link>
      <description>&lt;P&gt;/// &amp;lt;summary&amp;gt;&lt;BR /&gt;/// 模态显示图案选择对话框&lt;BR /&gt;/// &amp;lt;/summary&amp;gt;&lt;BR /&gt;/// &amp;lt;returns&amp;gt;成功返回&amp;lt;c&amp;gt;true&amp;lt;/c&amp;gt;&amp;lt;/returns&amp;gt;&lt;BR /&gt;public bool ShowDialog()&lt;BR /&gt;{&lt;BR /&gt;var dr = ShowHatchPaletteDialog(Name, ShowCustom, out var newPattern);&lt;BR /&gt;if (dr)&lt;BR /&gt;{&lt;BR /&gt;Name = Marshal.PtrToStringAuto(newPattern) ?? "";&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;return dr;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;[DllImport("acad.exe", CharSet = CharSet.Auto,&lt;BR /&gt;EntryPoint = "?acedHatchPalletteDialog@@YA_NPEB_W_NAEAPEA_W@Z")]&lt;BR /&gt;[return: MarshalAs(UnmanagedType.Bool)]&lt;BR /&gt;private static extern bool ShowHatchPaletteDialog(string currentPattern,&lt;BR /&gt;[MarshalAs(UnmanagedType.Bool)] bool showCustom, out IntPtr newPattern);&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jan 2025 01:36:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/hatch-patterns-list-and-preview/m-p/13251004#M1231</guid>
      <dc:creator>18348401357</dc:creator>
      <dc:date>2025-01-09T01:36:51Z</dc:date>
    </item>
    <item>
      <title>Re: Hatch patterns list and preview</title>
      <link>https://forums.autodesk.com/t5/net-forum/hatch-patterns-list-and-preview/m-p/13251388#M1232</link>
      <description>&lt;P&gt;Thanks for your answers guys!&lt;/P&gt;&lt;P&gt;Actually I know how to find the entry point, and am currently using the correct one for my platform.&lt;/P&gt;&lt;P&gt;I gave a try to suggested solution in the post above this one, but it does nothing, the dialog won't show up.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jan 2025 08:09:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/hatch-patterns-list-and-preview/m-p/13251388#M1232</guid>
      <dc:creator>jptallano</dc:creator>
      <dc:date>2025-01-09T08:09:33Z</dc:date>
    </item>
    <item>
      <title>Re: Hatch patterns list and preview</title>
      <link>https://forums.autodesk.com/t5/net-forum/hatch-patterns-list-and-preview/m-p/13252035#M1233</link>
      <description>&lt;P&gt;In that case, you will need to post the code that you are trying to get to work. I've had no problem with showing that dialogue using Code like the example I posted about. You also need to indicate what product and release you are using.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jan 2025 14:20:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/hatch-patterns-list-and-preview/m-p/13252035#M1233</guid>
      <dc:creator>ActivistInvestor</dc:creator>
      <dc:date>2025-01-09T14:20:42Z</dc:date>
    </item>
  </channel>
</rss>

