Watch High Resolution video of Part2a videos on AR-CAD
Part 2b:
Watch High Resolution video of Part2b videos on AR-CAD
Part 2c:
Watch High Resolution video of Part2c videos on AR-CAD
This video tutorial is in continuation of my earlier post on Developing Autodesk Inventor Addin using C# – part 1. In this session, we go a step further and create Command Button(s), that is added into a Custom Command Bar, which in turn gets added into Panel Bar of Assembly Files.
We start with a project that gets formed when we use Inventor Addins Template for C# language. We then add a couple of references and use most of the code from SimpleAddin that gets shipped along with Inventor in its SDK kit. We use the Button class from SimpleAddin as it is, and then append code to StandardAddInServer.cs file as explained in the video.
Some of the main points discussed in the video are as follows:
- How to deal with User Interface Event
- How to deal with Event Handler for Command Bars and Environments on Reset
- How to use ‘try & catch’ loop to handle errors effectively
- How to extend Button base class. Each ButtonCommand (AssemblyTreeButton) will have a Class which implements Button class
- How to load Image icons (.ico) for User Interface items
- How to create Buttons (CommandButtons)
- How to create Command Category
- How to add Button to Command Category
- How to create a custom command bar (toolbar), only the first time the addin loads up
- How to add a custom command bar to an available Environment (again only first time)
- How to Restore CommandBars and Environments and clean up the custom CommandBars and Environment changes done by activate method
- How to run a command when a button is clicked
- How to Build a Solution from Visual Studio 2005
- How to register and unregister an Addin using RegAsm.exe (easier way)
- How to check whether you addin has been loaded in the Inventor when it is started
I hope a lot of basics of a Command Button are covered in this video tutorial. In the coming ones, I would try to work on “Debugging an Addin from Visual Studio” and more complex addins which actually do something other than just showing some messages.
Please comment below if there is anything that is not clear. To view high resolution Videos of the above screencasts, check them out at AR-CAD at part2a, part2b, part2c.
Update: Looks like the install.bat and uninstall.bat files content are not very clear in the video, here are they in text
Install.bat
@echo off
C:WINDOWSMicrosoft.NETFrameworkv2.0.50727RegAsm.exe /codebase AR-CADInventorAddIn4.dll
PAUSE
Uninstall.bat
@echo off
C:WINDOWSMicrosoft.NETFrameworkv2.0.50727RegAsm.exe /unregister AR-CADInventorAddIn4.dll
PAUSE