By Adam Nagy
When you do not want to get your module loaded as soon as AutoCAD starts up, since this may slow down that process, you can wait till the user actually wants to use your command.
In that case instead of LoadOnAutoCADStartup="True" you can use LoadOnCommandInvocation="True". However, this requires that you specify the commands that AutoCAD should recognize even without your AddIn being loaded. You can do that by creating a Commands section in the PackageContents.xml of your autoloader bundle. All the commands listed here must also be registered on the command stack inside AutoCAD with the exact same parameters.
E.g. if this is how you register your command in .NET:
[CommandMethod("MyGroup", "MyCommand", CommandFlags.Modal)]
Then this is what the Commands section should look like:
<Command Global="MyCommand" Local="MyCommand"/>
You register commands on the command stack inside AutoCAD differently depending on the programming language. E.g. in C++/ARX it would be acedRegCmds->addCommand(), or a macro like ACED_ARXCOMMAND_ENTRY_AUTO, while in .NET you would use the CommandMethod() attribute. After this AutoCAD will know what function to call when one of your commands is executed.
Note: if you use the single parameter version of CommandMethod("MyCommand") then the name of the command group will be generated by AutoCAD - not sure what that will be exactly. So it's better to stick with the version that lets you specify the command group name as well - like in the above example - if you want to use them in the bundle's Commands section.
As mentioned in this blog post, it's not strictly necessary to include the Commands element if you don’t set your plug-in to LoadOnCommandInvocation="True", but it is required if you want the F1 help integration.
Here is a link to detailed info about the Autoloader bundle format: http://adndevblog.typepad.com/autocad/2013/01/autodesk-autoloader-white-paper.html