<?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: Autoload Commands in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/autoload-commands/m-p/1744181#M80663</link>
    <description>Code attached (Visual Basic code for .NET 2.0, ACAD2005)</description>
    <pubDate>Thu, 24 Aug 2006 13:13:09 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2006-08-24T13:13:09Z</dc:date>
    <item>
      <title>Autoload Commands</title>
      <link>https://forums.autodesk.com/t5/net-forum/autoload-commands/m-p/1744178#M80660</link>
      <description>Hi, &lt;BR /&gt;
&lt;BR /&gt;
I need to create a few new commands for AutoCad 2007 in VB.NET and also make an installation package that adds them to a new toolbar on machines with AutoCAD 2007 already installed. &lt;BR /&gt;
&lt;BR /&gt;
I am not too clear on how to make the toolbar and commands available as soon as the installation package has finished.&lt;BR /&gt;
&lt;BR /&gt;
From what I have read on the forums, there are two ways of doing this.&lt;BR /&gt;
&lt;BR /&gt;
1 - From within the installation package add keys to the registry like so..&lt;BR /&gt;
&lt;BR /&gt;
HKLM\Software\Autodesk\AutoCAD\R17.0\ACAD-5001:409\Applications &lt;BR /&gt;
\myApp&lt;BR /&gt;
"DESCRIPTION"="myApp"&lt;BR /&gt;
"LOADER"="C:\\wherever\\myApp .dll"&lt;BR /&gt;
"LOADCTRLS"=dword:00000002&lt;BR /&gt;
"MANAGED"=dword:00000001&lt;BR /&gt;
&lt;BR /&gt;
SubKey:&amp;lt; br&amp;gt;myApp\Commands&lt;BR /&gt;
"StartmyApp"="StartmyApp"&lt;BR /&gt;
&lt;BR /&gt;
(As seen in http://discussion.autodesk.com/thread.jspa?messageID=4531456)&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
2 - Create a shortcut that forces acad.exe to run with the argument /b somescriptfile.scr, and in that script file include the line:&lt;BR /&gt;
&lt;BR /&gt;
(command "netload" "C:\\wherever\\myCommands.dll")&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
I am new to AutoCAD programming, but somehow, neither of these two ways seem ideal, so my question is, Is there a better way of doing it ? &lt;BR /&gt;
&lt;BR /&gt;
Is there are script file that AutoCAD always executes by default where I could put the "(command "netload"..etc" line and taht way save me from having to create the shorcut and script file ?&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Thanks in advance,&lt;BR /&gt;
&lt;BR /&gt;
Julian</description>
      <pubDate>Wed, 23 Aug 2006 13:49:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/autoload-commands/m-p/1744178#M80660</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-08-23T13:49:27Z</dc:date>
    </item>
    <item>
      <title>Re: Autoload Commands</title>
      <link>https://forums.autodesk.com/t5/net-forum/autoload-commands/m-p/1744179#M80661</link>
      <description>The registry setting is probably the best way. One suggestion when you create the registry key is to read the Autodesk.AutoCAD.Runtime.SystemObjects.DynamicLinker.ProductKey property that contains the beginning portion of that registry path which will make your code a bit more robust if AutoCAD is updated. Also make sure you read the different values for LOADCTRLS - it determines what events (ACAD startup, command execution, etc.) will trigger your application loading.</description>
      <pubDate>Wed, 23 Aug 2006 15:59:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/autoload-commands/m-p/1744179#M80661</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-08-23T15:59:17Z</dc:date>
    </item>
    <item>
      <title>Re: Autoload Commands</title>
      <link>https://forums.autodesk.com/t5/net-forum/autoload-commands/m-p/1744180#M80662</link>
      <description>Thanks smc, &lt;BR /&gt;
&lt;BR /&gt;
Yes, If I dont have to hardcode the registry path, the registry way, does begin to look like the better option.&lt;BR /&gt;
&lt;BR /&gt;
Although I am finding very little info on the ProductKey property. It would be great if you have an example on how to obtain it. &lt;BR /&gt;
&lt;BR /&gt;
But you have definitely put me on the right track.&lt;BR /&gt;
&lt;BR /&gt;
Thanks again&lt;BR /&gt;
&lt;BR /&gt;
julian</description>
      <pubDate>Thu, 24 Aug 2006 08:18:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/autoload-commands/m-p/1744180#M80662</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-08-24T08:18:57Z</dc:date>
    </item>
    <item>
      <title>Re: Autoload Commands</title>
      <link>https://forums.autodesk.com/t5/net-forum/autoload-commands/m-p/1744181#M80663</link>
      <description>Code attached (Visual Basic code for .NET 2.0, ACAD2005)</description>
      <pubDate>Thu, 24 Aug 2006 13:13:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/autoload-commands/m-p/1744181#M80663</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-08-24T13:13:09Z</dc:date>
    </item>
    <item>
      <title>Re: Autoload Commands</title>
      <link>https://forums.autodesk.com/t5/net-forum/autoload-commands/m-p/1744182#M80664</link>
      <description>You can only use 'Autodesk.AutoCAD.Runtime.SystemObjects.DynamicLinker.ProductKey' if you are running inside of AutoCAD, thus defeats the purpose of having application immediately available after installation.&lt;BR /&gt;
&lt;BR /&gt;
Instead store 'HKEY_LOCAL_MACHINE\SOFTWARE\Autodesk\AutoCAD\' and then iterate each version 'R16.2', 'R17.0', etc., then vertical 'ACAD-4001:409'.  Under each vertical is the Applications folder you will need to add your app to.&lt;BR /&gt;
&lt;BR /&gt;
Using this method you can create a console app and run it from the Commit and Uninstall portions of the installer.</description>
      <pubDate>Thu, 24 Aug 2006 14:49:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/autoload-commands/m-p/1744182#M80664</guid>
      <dc:creator>RonnieWilkins</dc:creator>
      <dc:date>2006-08-24T14:49:42Z</dc:date>
    </item>
    <item>
      <title>Re: Autoload Commands</title>
      <link>https://forums.autodesk.com/t5/net-forum/autoload-commands/m-p/1744183#M80665</link>
      <description>I require an initial netload of the application first for the user - hence, I have the ProductKey value available. If you would prefer to avoid this, RWilkins solution is best. The code should still work fine though, there is just some extra logic necessary at the beginning to find all the AutoCAD product keys to add it to.</description>
      <pubDate>Thu, 24 Aug 2006 14:54:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/autoload-commands/m-p/1744183#M80665</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-08-24T14:54:35Z</dc:date>
    </item>
    <item>
      <title>Re: Autoload Commands</title>
      <link>https://forums.autodesk.com/t5/net-forum/autoload-commands/m-p/1744184#M80666</link>
      <description>Thanks a lot guys.&lt;BR /&gt;
&lt;BR /&gt;
I´ll blend your answers to make it work.&lt;BR /&gt;
&lt;BR /&gt;
julian</description>
      <pubDate>Fri, 25 Aug 2006 08:19:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/autoload-commands/m-p/1744184#M80666</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-08-25T08:19:28Z</dc:date>
    </item>
    <item>
      <title>Re: Autoload Commands</title>
      <link>https://forums.autodesk.com/t5/net-forum/autoload-commands/m-p/1744185#M80667</link>
      <description>Thanks a lot guys.&lt;BR /&gt;
&lt;BR /&gt;
I´ll blend your answers to make it work.&lt;BR /&gt;
&lt;BR /&gt;
julian</description>
      <pubDate>Fri, 25 Aug 2006 08:21:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/autoload-commands/m-p/1744185#M80667</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-08-25T08:21:59Z</dc:date>
    </item>
  </channel>
</rss>

