Here is the complete content of one of my AU 2012 class dealing about design patterns and let’s say tips & tricks or good practices when it comes to developing Inventor add-ins.
Developing add-ins in general, but especially Inventor ones since it is our focus here, has this in common that you will need most of the time to create a new project and setup the plumbing for couple of common things: typically the .addin file registration steps, including copying that file to the correct location for debug testing; if you have written add-ins previously, you will also most likely want to reuse a few utility functions that handle basic task about the operating system, picture conversion and more depending on what your add-in is doing; in case your add-in provides new functionality, you want it to create at least one command so the end user can access it through the Inventor graphical interface. For that you need to create new elements through the Ribbon bar and potentially implement user interaction mechanism if your command is going to prompt the user for any kind of selection.
In this class I tried to gather the most useful knowledge I acquired over the past few years where I have been supporting developers about Inventor API related questions, writing several add-ins myself and also collecting interesting ideas and techniques collected among my colleagues at Autodesk.
The purpose of this document is to expose some common tasks, reusable code samples and also propose an implementation of a few design patterns, directly applied to the Inventor API and specific to add-in creation.
To maximize reusability and efficiency of this content, I wrapped it all up inside a Visual Studio project template and associated item templates. With a slight experience of Inventor add-in programming, a developer should be able, through the use of those templates, to generate from scratch a fully functional Inventor command with less than five minutes of work!