AutoCAD 2012 – Autoloader mechanism for plug-ins

One of the less obvious features introduced by AutoCAD 2012 is the Autoloader mechanism that has been provided to make installation of plug-ins (current standard Autodeskspeak for add-ons, apps, utilities, routines, etc.) easier for both developers and users. It may not be immediately obvious, but it’s a useful and important addition.

This mechanism has nothing to do with the AppLoad command, the Startup Suite, acad*.lsp, the (autoload) function or anything else that existed in earlier releases. This is completely new, it has not replaced or broken any of the existing loading mechanisms, and is, in short, A Good Thing. Developers don’t have to use it, but those who do, and their customers, will have certain advantages. I have used it for the ClassicArray loading mechanism, and I expect to see it used by more and more plug-ins over time. It works fine with all of the usual AutoCAD add-on APIs, including LISP.

User perspective
As a user, what this means is that for AutoCAD and related applications from 2012 on, there is a standard loading mechanism for plug-ins. The installation should be straightforward, with no multi-step processes to go through for different AutoCAD variants and releases. The result of the installation should automatically present itself in a standard way, with a short-lived welcome bubble, an extra panel in the new Plug-ins Ribbon tab, plus any other interface additions the developer wants to provide. If you subsequently install another AutoCAD variant or release, the plug-in will automatically appear in that variant with no further user action required, as long as that AutoCAD variant is supported by the plug-in.

Developer perspective
What this means for me as a developer is that I have much less to worry about in terms of installation. All that needs to be done to make the loading happen is for a folder full of ‘stuff’ to be copied into a certain location. (There are actually two possible locations, but more on that later).

In Betas of ClassicArray, I just provided the folder, plus instructions that asked the user to copy that folder into place. I could have simplified that further by providing batch files that did the copying. In the end, I created setup executables using the free Inno Setup utility, but that was a much easier job that it would have been if this Autoloader mechanism didn’t exist. I didn’t have to worry about discovering what releases were installed, deciphering Registry entries, creating user installaton scripts, or issuing instructions to users to edit files or mess with the AppLoad command. I don’t have to worry about what happens if the user subsequently installs another AutoCAD variant.

Of course, for developers who support releases prior to 2012, there is no less work to do than before, and some time needs to be spent to learn and implement the new mechanism. In the case of ClassicArray, that was not an issue because it’s only needed and supported in 2012. I expect this is one of those problems that will resolve itself over time as developers adopt the new mechanism.

The bundle folder
So what is this ‘stuff’ that needs copying into place? It’s called a bundle folder. It’s just a folder with a name that ends in .bundle (e.g. ClassicArray.bundle), and it typically contains the usual files needed to run your add-in, often tidied up within other folders. The only new thing that it needs to contain is a file called PackageContents.xml. That XML file is the key to the Autoloader mechanism. AutoCAD finds the file, reads it, and acts accordingly in terms of version support, loading program files, partial cuix files and so on.

Bundle folder location
So where does this folder with its XML file have to go? There are two possible locations. If you want the plug-in to be available to all users on the computer, you place it in the Autodesk\ApplicationPlugins folder underneath the system’s ProgramFiles folder. For example, ClassicArray usually gets put here:

C:\Program Files\Autodesk\ApplicationPlugins\ClassicArray.bundle

If you only want the plug-in to be loaded for the current user, it goes in the Autodesk\ApplicationPlugins folder underneath the system’s AppData folder instead, for example:

C:\Documents and Settings\[login]\Application Data\Roaming\Autodesk\ApplicationPlugins\ClassicArray.bundle

in XP or

C:\Users\[login]\AppData\Roaming\Autodesk\ApplicationPlugins\ClassicArray.bundle

in Windows 7.

Describing the contents of that all-important XML file is beyond the scope of this post, but I may do a follow-up post if there is enough interest. In either case, the reference material is available in the AutoCAD Help, under Help > Customization Guide > Introduction to Programming Interfaces > Install and Uninstall Plug-In Applications > PackageContents.xml Format.

16 thoughts on “AutoCAD 2012 – Autoloader mechanism for plug-ins

  1. Ken Krupa

    Thanks for this article Steve. For me it cleared up how the app can go in the Program Files location instead of the Roaming location. The info previously provided by Adesk hinted at something like this but was not specific, and I had not found my way to that Help section.

    Now that I see the “help” on the .xml, if you would translate that into something more understandable that would be greatly appreciated.

    Reply
  2. Suzy

    I’ve just jumped from AutoCAD 2000 to 2012 Lt. I’ve been able to customize most of my “hot keys” that I’ve been using for all previous releases, but
    I’m having trouble with the cht.lsp file. I use this constantly, and am afraid I won’t be able to find a comparable command.
    This .lsp file goes in the Support folder, but I see no other .lsp files in there. Can you help me with that?

    I also was used to the change properties command where I could select something and by using the keyboard (which I totally prefer)
    change out the linetype, color, layer, etc… Where did that go?

    I hope you can help me.
    Thanks…Suzy

    Reply
    1. Steve Johnson Post author

      Suzy, sorry, but you’re not going to be able to use your LISP routine with 2012 LT. The most important thing that Autodesk chopped out of AutoCAD to make LT was LISP.

      I don’t have LT so I can’t test this, but does the CHPROP command not exist in 2012 LT? It’s there in full AutoCAD 2012. If it’s been removed, how about the CHANGE command?

      Reply
  3. Suzy

    Hi Steve – thank you for answering my question. AutoCAD LT 2012 does have alot of really great features. I was able to find the CHPROP and change command so that’s not a problem.
    This cht.lisp allowed me to change the text height or style very rapidly. I’m sure if I search around AutoCAD 2012…I’ll find something comparable…maybe even quicker.
    If you know of anything, pleast write me back!

    Thanks again.
    Suzy

    Reply
  4. Suzy

    One more comment, Steve. The part I loved about cht.lisp is that you could globally set the text height throughout the drawing. In other word…if all the text
    was 6″ and you needed them all a uniform 10″…you would be able to change it throughout.
    Any thoughts on what AutoCAD 2012 might replace that with?
    Thanks, again.
    Suzy

    Reply
    1. Steve Johnson Post author

      Suzy, you can use the Properties palette (PROPS command) and the Quick Select button (QSELECT command) to do this. In the Quick Select dialog, change the object type to Text (or Mtext if that’s what you have), then change the Operator to Select All and pick OK. With all the text now selected, you can change the Text height value to whatever you want.

      Reply
  5. michael

    Steve-
    Awesome info, thanks. I have a problem and I wonder if it is related to this article. I exported a profile from 2011 to 2012 when i newly installed 2012. Everything came over fine but the problem I have now is when I use APPLOAD to load all of my lisp routines, they work fine until i exit ACAD. Once I get back in ACAD they still show up in the startup suite but are no longer recognized. Once I use APPLOAD again, they work fine…until I close ACAD. Any thoughts, suggestions or ideas? Thanks so much we all appreciate you a ton. Have a great day!
    Michael

    Reply
  6. Paul Stefanic

    Same here Steve. I have to continually reload all the lisp files even though they are listed in the startup suite every time I open a new drawing.

    Reply
    1. Paul Stefanic

      Just wanted to see if anyone else beside Michael and myself are still having this issue with startup suite?

      Reply
  7. Gino

    @ Paul Stefanic

    I started to have the same problem after messing with acad.lsp to have all my settings reset to what I want them to be at each AutoCAD startup.

    Reply
  8. Micah Winniman

    I have been having the same problem. I went from 2011 to 2012, and it wasn’t a huge problem, but now that I’m on ACA 2013 it seems like it only loads a hand full of my lisp files.

    What I did is I found one that it will load every time and I pasted a bunch of lisps into that file.

    I’m thinking there has to be a better way.

    Reply
  9. James

    Hey Steve, noticed your comments over on kean walmsley’s blog about restricted access to the Exchange Apps web page – i.e. only being able to access it through AutoCAD. The link below seems to work. Sadly your typical AutoCAD user won’t be directed there.

    http://apps.exchange.autodesk.com/ACD/Home/Index

    I whole-heartedly agree with you regarding help for AutoCAD 2013 – it has gone backwards. Online help should be online help, press F1 and it should simply launch your default web browser and go to the relevant page. I’m pretty sure this is HTML 101. I’m not going to bother much with the 2013 help until they fix it – if i take a cynical view, perhaps we’re waiting for someone to write it 🙂

    p.s. There seems to be something wrong with the url link to this post from the main page, i had to edit it to get in.

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.