<?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: Using AcCoreConsole with dll to batch process in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/using-accoreconsole-with-dll-to-batch-process/m-p/12576707#M5393</link>
    <description>&lt;P&gt;Thanks for the info. I'll check it out.&lt;/P&gt;</description>
    <pubDate>Thu, 22 Feb 2024 17:26:58 GMT</pubDate>
    <dc:creator>Ed__Jobe</dc:creator>
    <dc:date>2024-02-22T17:26:58Z</dc:date>
    <item>
      <title>Using AcCoreConsole with dll to batch process</title>
      <link>https://forums.autodesk.com/t5/net-forum/using-accoreconsole-with-dll-to-batch-process/m-p/12574952#M5389</link>
      <description>&lt;P&gt;I have a question regarding using a dll with the console app. I know you can load a dll with the /loadmodule switch, but can the dll autorun a command or do you also need to use the /s switch to load a script to run the command?&lt;/P&gt;</description>
      <pubDate>Thu, 22 Feb 2024 00:15:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/using-accoreconsole-with-dll-to-batch-process/m-p/12574952#M5389</guid>
      <dc:creator>Ed__Jobe</dc:creator>
      <dc:date>2024-02-22T00:15:31Z</dc:date>
    </item>
    <item>
      <title>Re: Using AcCoreConsole with dll to batch process</title>
      <link>https://forums.autodesk.com/t5/net-forum/using-accoreconsole-with-dll-to-batch-process/m-p/12575099#M5390</link>
      <description>&lt;P&gt;It likely depends on the load sequence and the code within your .NET assembly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If the target drawing is already open in Core Console when the assembly is loaded, then you can presumably include a call to SendStringToExecute() just fine (I haven't tried).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Most of my code where I want it to auto-run on load for this scenario simply calls the Method associate with the CommandMethod attribute.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you load the assembly before the target drawing is loaded (or Core Console NETLOADs before opening the DWG via command switches), then it will obviously not have the desired result without the need for a Script to then call same (post-DWG open), or your assembly needs to also handle Document events to do so internally.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;HTH&lt;/P&gt;</description>
      <pubDate>Thu, 22 Feb 2024 02:39:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/using-accoreconsole-with-dll-to-batch-process/m-p/12575099#M5390</guid>
      <dc:creator>BlackBox_</dc:creator>
      <dc:date>2024-02-22T02:39:35Z</dc:date>
    </item>
    <item>
      <title>Re: Using AcCoreConsole with dll to batch process</title>
      <link>https://forums.autodesk.com/t5/net-forum/using-accoreconsole-with-dll-to-batch-process/m-p/12576499#M5391</link>
      <description>&lt;P&gt;Thanks &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1206685"&gt;@BlackBox_&lt;/a&gt; Can you enlighten me on other methods that you are referring to which runs AcCoreConsole? I just know how to start it with a command line in a bat file. Where are you calling the command method? How are you loading the assembly before the dwg?&lt;/P&gt;</description>
      <pubDate>Thu, 22 Feb 2024 16:21:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/using-accoreconsole-with-dll-to-batch-process/m-p/12576499#M5391</guid>
      <dc:creator>Ed__Jobe</dc:creator>
      <dc:date>2024-02-22T16:21:09Z</dc:date>
    </item>
    <item>
      <title>Re: Using AcCoreConsole with dll to batch process</title>
      <link>https://forums.autodesk.com/t5/net-forum/using-accoreconsole-with-dll-to-batch-process/m-p/12576684#M5392</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/14801"&gt;@Ed__Jobe&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;Thanks &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1206685"&gt;@BlackBox_&lt;/a&gt; Can you enlighten me on other methods that you are referring to which runs AcCoreConsole? I just know how to start it with a command line in a bat file. Where are you calling the command method? How are you loading the assembly before the dwg?&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Enlighten? Probably not. Haha&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I appreciate that Civil 3D team provides the standalone batch utility for batch processing via Core Console, but always found it cumbersome that I had to quit acad.exe, so I rolled my own LISP to do similar for a selection of drawings in parallel:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://forums.augi.com/showthread.php?172630-Assign-Layer-State-to-Viewport&amp;amp;p=1339054&amp;amp;viewfull=1#post1339054" target="_blank" rel="noopener"&gt;https://forums.augi.com/showthread.php?172630-Assign-Layer-State-to-Viewport&amp;amp;p=1339054&amp;amp;viewfull=1#post1339054&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I also have a few tasks that I've grown accustom to running outside of CAD, using File Explorer shell menu; here's one of them:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.theswamp.org/index.php?topic=51181.msg563128#msg563128" target="_blank" rel="noopener"&gt;https://www.theswamp.org/index.php?topic=51181.msg563128#msg563128&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Don't forget that you can also load AutoCAD's ARX to do things in Core Console not possible by default, like call &lt;SPAN&gt;(layoutlist) in LISP/Script&lt;/SPAN&gt;:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.theswamp.org/index.php?topic=57471.msg609440#msg609440" target="_blank" rel="noopener"&gt;https://www.theswamp.org/index.php?topic=57471.msg609440#msg609440&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As for .NET, here's a quick Sample, which calls a method on load (if active document is valid), and on subsequent documents opened (works in full AutoCAD or Core Console). Rather than revise the code to instead call CommandMethod, I'd simply NETLOAD the assembly and use Script to invoke the Command:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;namespace Sample
{
    class Events : IExtensionApplication
    {
        private static DocumentCollection acDocs = acApp.DocumentManager;

        public void Initialize()
        {
            acApp.Idle += onIdle;
        }
        public void Terminate()
        {
        }
        [CommandMethod("FOO", "DoSomethingUseful", CommandFlags.Session)]
        public static void DoSomethingUseful()
        {  
            //&amp;lt;-- do something useful
        }
        public static void onIdle(object sender, EventArgs e)
        {
            acApp.Idle -= onIdle;

            Settings.Load();

            acDocs.DocumentCreated += onDocumentCreated;

            Document doc = acDocs.MdiActiveDocument;

            if (doc != null)
            {
                doc.CommandWillStart += onCommandWillStart;

                doc.Editor.WriteMessage("\nCore Console tools loaded. \n");

                DoSomethingUseful();
            }
        }
        private static void onDocumentCreated(object sender, DocumentCollectionEventArgs e)
        {
            if (e.Document != null &amp;amp;&amp;amp; !e.Document.IsReadOnly)
            {
                e.Document.CommandWillStart += onCommandWillStart;

                DoSomethingUseful();
            }
        }
        //&amp;lt;snip&amp;gt;
    }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;HTH&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Feb 2024 17:42:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/using-accoreconsole-with-dll-to-batch-process/m-p/12576684#M5392</guid>
      <dc:creator>BlackBox_</dc:creator>
      <dc:date>2024-02-22T17:42:58Z</dc:date>
    </item>
    <item>
      <title>Re: Using AcCoreConsole with dll to batch process</title>
      <link>https://forums.autodesk.com/t5/net-forum/using-accoreconsole-with-dll-to-batch-process/m-p/12576707#M5393</link>
      <description>&lt;P&gt;Thanks for the info. I'll check it out.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Feb 2024 17:26:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/using-accoreconsole-with-dll-to-batch-process/m-p/12576707#M5393</guid>
      <dc:creator>Ed__Jobe</dc:creator>
      <dc:date>2024-02-22T17:26:58Z</dc:date>
    </item>
    <item>
      <title>Re: Using AcCoreConsole with dll to batch process</title>
      <link>https://forums.autodesk.com/t5/net-forum/using-accoreconsole-with-dll-to-batch-process/m-p/13821760#M85786</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1206685"&gt;@BlackBox_&lt;/a&gt;&amp;nbsp;, this looks interesting. But how to apply it to accoreconsole, when I have a scr file, and which I will need to pass in a drawing full file path in the scr file?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Sep 2025 08:56:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/using-accoreconsole-with-dll-to-batch-process/m-p/13821760#M85786</guid>
      <dc:creator>soonhui</dc:creator>
      <dc:date>2025-09-23T08:56:10Z</dc:date>
    </item>
    <item>
      <title>Re: Using AcCoreConsole with dll to batch process</title>
      <link>https://forums.autodesk.com/t5/net-forum/using-accoreconsole-with-dll-to-batch-process/m-p/13821996#M85787</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/7472042"&gt;@soonhui&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1206685"&gt;@BlackBox_&lt;/a&gt;&amp;nbsp;, this looks interesting. But how to apply it to accoreconsole, when I have a scr file, and which I will need to pass in a drawing full file path in the scr file?&amp;nbsp;&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/7472042"&gt;@soonhui&lt;/a&gt;&amp;nbsp;- &lt;A href="https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/discovered-publish-does-not-use-cached-xrefs-chat-gpt-summary-of/m-p/13772305#M165955" target="_blank" rel="noopener"&gt;this&lt;/A&gt; may help.&lt;/P&gt;</description>
      <pubDate>Tue, 23 Sep 2025 12:37:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/using-accoreconsole-with-dll-to-batch-process/m-p/13821996#M85787</guid>
      <dc:creator>BlackBox_</dc:creator>
      <dc:date>2025-09-23T12:37:58Z</dc:date>
    </item>
    <item>
      <title>Re: Using AcCoreConsole with dll to batch process</title>
      <link>https://forums.autodesk.com/t5/net-forum/using-accoreconsole-with-dll-to-batch-process/m-p/14054906#M86665</link>
      <description>&lt;P&gt;/loadmodule seems to work only with ARX/DBX/CRX files (native DLLs), but not with managed (.NET) files.&lt;/P&gt;</description>
      <pubDate>Sun, 15 Mar 2026 10:39:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/using-accoreconsole-with-dll-to-batch-process/m-p/14054906#M86665</guid>
      <dc:creator>FRFR1426</dc:creator>
      <dc:date>2026-03-15T10:39:02Z</dc:date>
    </item>
  </channel>
</rss>

