<?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: Netloading dll from a script file for batch processing in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/netloading-dll-from-a-script-file-for-batch-processing/m-p/5945027#M37751</link>
    <description>&lt;P&gt;Instead of&lt;/P&gt;&lt;P&gt;(command "WTD")&lt;/P&gt;&lt;P&gt;try&lt;/P&gt;&lt;P&gt;(C:WTD)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Further to that, to debug scripts just type the lines from your script as responses in AutoCAD. You probably already know that...&lt;/P&gt;&lt;P&gt;Dale&lt;/P&gt;</description>
    <pubDate>Thu, 10 Dec 2015 05:59:37 GMT</pubDate>
    <dc:creator>Dale.Bartlett</dc:creator>
    <dc:date>2015-12-10T05:59:37Z</dc:date>
    <item>
      <title>Netloading dll from a script file for batch processing</title>
      <link>https://forums.autodesk.com/t5/net-forum/netloading-dll-from-a-script-file-for-batch-processing/m-p/5944940#M37750</link>
      <description>&lt;P&gt;Hi folks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;this is giving me a lot of grief:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;I have Scprit Pro 2.0 (if you don't know, it's a nifty little tool which allows you to batch process drawings.&lt;/LI&gt;&lt;LI&gt;I have some 40 drawings or so.&lt;/LI&gt;&lt;LI&gt;I need to open all the drawings. Then Netload a&amp;nbsp;dll, and to then run a custom command which I created in the dll called "WTD" - the name is not important.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But somewhere along the line it is stuffing up.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;IT is working neither with Core Console, nor with the setting which actually opens autocad.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is my &lt;STRONG&gt;scriptfile&lt;/STRONG&gt;:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;;Loading the .Net module
(command "netload" "C:\\TopSecret\\MyProject.dll")
;
; Run the command
(command "WTD")&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and here is the log file output that is produced:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;------------------------------------------------------------------------------
------------------------------------------------------------------------------
Project file: 	
Drawing file: 	C:\TopScret\Drawing1235.dwg

Processed by Computer: 	BARNABAS-PC

User name   : 	BKSpurgeon

[ Status summary ]
Done


A u t o C A D   C o r e   E n g i n e   C o n s o l e   -   C o p y r i g h t   A u t o d e s k ,   I n c   2 0 0 9 - 2 0 1 3 . 
 
 R e g e n e r a t i n g   m o d e l . 
 
 P r e s s   E N T E R   t o   c o n t i n u e : 
 
 
 
 C o m m a n d : 
 
 C o m m a n d : 
 
 
 
 C o m m a n d : 
 
 C o m m a n d :   ( c o m m a n d   " n e t l o a d "   " C : \ \ t o p secret \ b i n \ D e b u g \ M a i n . d l l   a s s e m b l y . 
 
 C o m m a n d :   n i l 
 
 
 
 C o m m a n d :   ( c o m m a n d   " W T D " ) 
 
 W T D   U n k n o w n   c o m m a n d   " W T D " .     P r e s s   F 1   f o r   h e l p . 
 
 
 
 C o m m a n d :   n i l 
 
 
 
 C o m m a n d :   _ q u i t 
 
 
 
 &lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am at a complete loss. your assistance is much appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;rgds&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;BK&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Dec 2015 03:13:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/netloading-dll-from-a-script-file-for-batch-processing/m-p/5944940#M37750</guid>
      <dc:creator>BKSpurgeon</dc:creator>
      <dc:date>2015-12-10T03:13:04Z</dc:date>
    </item>
    <item>
      <title>Re: Netloading dll from a script file for batch processing</title>
      <link>https://forums.autodesk.com/t5/net-forum/netloading-dll-from-a-script-file-for-batch-processing/m-p/5945027#M37751</link>
      <description>&lt;P&gt;Instead of&lt;/P&gt;&lt;P&gt;(command "WTD")&lt;/P&gt;&lt;P&gt;try&lt;/P&gt;&lt;P&gt;(C:WTD)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Further to that, to debug scripts just type the lines from your script as responses in AutoCAD. You probably already know that...&lt;/P&gt;&lt;P&gt;Dale&lt;/P&gt;</description>
      <pubDate>Thu, 10 Dec 2015 05:59:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/netloading-dll-from-a-script-file-for-batch-processing/m-p/5945027#M37751</guid>
      <dc:creator>Dale.Bartlett</dc:creator>
      <dc:date>2015-12-10T05:59:37Z</dc:date>
    </item>
    <item>
      <title>Re: Netloading dll from a script file for batch processing</title>
      <link>https://forums.autodesk.com/t5/net-forum/netloading-dll-from-a-script-file-for-batch-processing/m-p/5945631#M37752</link>
      <description>&lt;P&gt;To me, it looks like the DLL loading is failed, thus the "unknown command" message.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Firstly, your scrip shows the DLL to be loaded is&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;"C:\\TopSecret\\MyProject.dll"&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But the log says:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;"C:\\TopSecret\bin\debug\main.dll"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please notice that not only the file name is different, but also the "\" used in the file path is not consistent: it should all be doubled.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Could this be the problem (sometimes a typo makes debugging very difficult before you finally see the obvious typo).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then assume you have correct file path/file name, but still have the same issue, then another possible cause could be code security, unless you use core console with AutoCAD2013: the DLL has to be loaded from trusted folder. You can first try to do exactly what the script does manually with AutoCAD running stet by step, to make sure you do not have security message pops up when loading the same DLL and the command can be called manually. However, even your manul process works, your automated core console may still have issue because it may run under different AutoCAD profile. In term of trusted code location, you may want to place your dll into location always trusted by AutoCAD, such as "C:\ProgramData\Autodesk\ApplicationPlugins\"&lt;/P&gt;</description>
      <pubDate>Thu, 10 Dec 2015 14:35:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/netloading-dll-from-a-script-file-for-batch-processing/m-p/5945631#M37752</guid>
      <dc:creator>norman.yuan</dc:creator>
      <dc:date>2015-12-10T14:35:48Z</dc:date>
    </item>
    <item>
      <title>Re: Netloading dll from a script file for batch processing</title>
      <link>https://forums.autodesk.com/t5/net-forum/netloading-dll-from-a-script-file-for-batch-processing/m-p/5947184#M37753</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1) In addition to above&amp;nbsp;suggestions, can you also try&amp;nbsp;setting&amp;nbsp;SECURELOAD to 0 in the script file.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the load is failing due to trust issues, this should help identify it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2) Also, you can try running AccoreConsole as a stand-alone application from the AutoCAD's install path.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In its prompt, try to load the dll and run the command. That should help debug the issue.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;3) Ensure that the .Net plugin that you are trying to load does not reference acmgd.dll.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am sure you know this already, but wanted to remind.&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="line-height: 15px;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Balaji&lt;/P&gt;</description>
      <pubDate>Fri, 11 Dec 2015 09:08:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/netloading-dll-from-a-script-file-for-batch-processing/m-p/5947184#M37753</guid>
      <dc:creator>Balaji_Ram</dc:creator>
      <dc:date>2015-12-11T09:08:38Z</dc:date>
    </item>
    <item>
      <title>Re: Netloading dll from a script file for batch processing</title>
      <link>https://forums.autodesk.com/t5/net-forum/netloading-dll-from-a-script-file-for-batch-processing/m-p/5949011#M37754</link>
      <description>&lt;P&gt;thank you all.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i am in the process of debugging. Will post full solutions when i get it right for the benefit of future users.&amp;nbsp;In the mean time, norman has identified a potential source of error: the path names. in truth i edited the path names before publicly posting etc and i forgot to do it the same.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the core console does not allow for cutting and pasting file names so this should come in extremely handy for you all:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="http://stackoverflow.com/questions/131955/keyboard-shortcut-to-paste-clipboard-content-into-command-prompt-window-win-xp" target="_blank"&gt;http://stackoverflow.com/questions/131955/keyboard-shortcut-to-paste-clipboard-content-into-command-prompt-window-win-xp&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.autohotkey.com/" target="_blank"&gt;https://www.autohotkey.com/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and here is my script file: which allwos you to paste into console windows:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;; Redefine only when the active window is a console window 
#IfWinActive ahk_class ConsoleWindowClass

; Close Command Window with Ctrl+w
$^w::
WinGetTitle sTitle
If (InStr(sTitle, "-")=0) { 
	Send EXIT{Enter}
} else {
	Send ^w
}

return 


; Ctrl+up / Down to scroll command window back and forward
^Up::
Send {WheelUp}
return

^Down::
Send {WheelDown}
return


; Paste in command window
^V::
; Spanish menu (Editar-&amp;gt;Pegar, I suppose English version is the same, Edit-&amp;gt;Paste)
Send !{Space}ep
return

#IfWinActive&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;remember to save as a .ahk extension and save it to either you documents folder or to the place where the executable file is running from. then run program. it's a very handy utility.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;debegging with core console&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;like the folks here had suggested, i tried debugging manually. the netloading is working. but when i used Script Pro 2.0 and a script file (see above) - with a refined path name, it was throwing an error:&amp;nbsp;"&lt;SPAN&gt;Error while reading log file" which i will fully investigate a post here for the benefit of future readres.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;rgds&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;BK&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;rgds&lt;/P&gt;&lt;P&gt;BK&lt;/P&gt;</description>
      <pubDate>Sun, 13 Dec 2015 01:35:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/netloading-dll-from-a-script-file-for-batch-processing/m-p/5949011#M37754</guid>
      <dc:creator>BKSpurgeon</dc:creator>
      <dc:date>2015-12-13T01:35:48Z</dc:date>
    </item>
  </channel>
</rss>

