Wednesday, July 13, 2005
Add-In Versioning In Autodesk Inventor
Platform: Inventor 10
Download: n/a
I've recently been developing an Add-In for Inventor to bring together all the utilities I've developed over the last few years. One of the utilities requires a new toolbar in Inventor whenever a part or assembly document is open. The API help files are pretty good but they have an issue with version skew. Page 6 of the UI Customization overview explains AddIn Versioning in depth but Page 3 of the Add-In overview doesn't have the Version entry added to the registry file example.
If you are developing an Add-In that deals with CommandBar creation or attaching buttons to a command bar listen up! The FirstTime variable will never be set to False in the ApplicationAddInServer_Activate event if you compile and run your Add-In. This means that you have ONE CHANCE to get it right.
I posted this dilemma on the Inventor customization newsgroup (http://discussion.autodesk.com/forum.jspa?forumID=120) and was quickly supplied with an answer from Sanjay Ramaswamy at Autodesk:
The FirstTime argument will be true only when your Add-In is being loaded for
the very first time after registration. User interface items such as command
bars & controls need to be created only during the first time and they will
be persisted by Inventor. Please see page 6 of the UI Customization overview
in Programming Help for a detailed explanation regarding this.
In order to work around your present situation, you can force the FirstTime
flag to True by changing the value of the "Version" entry in your Add-In's
registry (the same place where you set things such as LoadOnStartUp,
SupportedSoftwareVersionEqualTo, etc. Just increment the value of the
Version entry to 1 (and 2,3,4,.... for each time you want to change the way
your user interface looks).
Here's a link to the full discussion thread:
Here's the Registry file I'm currently using and it seems to be working just fine:
REGEDIT4
[HKEY_CLASSES_ROOT\CLSID\{57E6E593-2CAE-4016-AE01-74BB752C670E}]
@="SolidCAD ToolBox"
[HKEY_CLASSES_ROOT\CLSID\{57E6E593-2CAE-4016-AE01-74BB752C670E}\Description]
@="A collection of useful routines supplied by SolidCAD Inc."
[HKEY_CLASSES_ROOT\CLSID\{57E6E593-2CAE-4016-AE01-74BB752C670E}\Implemented Categories\{39AD2B5C-7A29-11D6-8E0A-0010B541CAA8}]
[HKEY_CLASSES_ROOT\CLSID\{57E6E593-2CAE-4016-AE01-74BB752C670E}\Required Categories]
[HKEY_CLASSES_ROOT\CLSID\{57E6E593-2CAE-4016-AE01-74BB752C670E}\Required Categories\{E357129B-DB40-11D2-B783-0060B0F159EF}]
[HKEY_CLASSES_ROOT\CLSID\{57E6E593-2CAE-4016-AE01-74BB752C670E}\Settings]
"LoadOnStartUp"="1"
"Type"="Standard"
"Version"="10"
"SupportedSoftwareVersionEqualTo"="10.."
You're really missing out on a great resource if you haven't checked out the Autodesk Discussion Groups.
Thanks again Sanjay.
Download: n/a
I've recently been developing an Add-In for Inventor to bring together all the utilities I've developed over the last few years. One of the utilities requires a new toolbar in Inventor whenever a part or assembly document is open. The API help files are pretty good but they have an issue with version skew. Page 6 of the UI Customization overview explains AddIn Versioning in depth but Page 3 of the Add-In overview doesn't have the Version entry added to the registry file example.
If you are developing an Add-In that deals with CommandBar creation or attaching buttons to a command bar listen up! The FirstTime variable will never be set to False in the ApplicationAddInServer_Activate event if you compile and run your Add-In. This means that you have ONE CHANCE to get it right.
I posted this dilemma on the Inventor customization newsgroup (http://discussion.autodesk.com/forum.jspa?forumID=120) and was quickly supplied with an answer from Sanjay Ramaswamy at Autodesk:
The FirstTime argument will be true only when your Add-In is being loaded for
the very first time after registration. User interface items such as command
bars & controls need to be created only during the first time and they will
be persisted by Inventor. Please see page 6 of the UI Customization overview
in Programming Help for a detailed explanation regarding this.
In order to work around your present situation, you can force the FirstTime
flag to True by changing the value of the "Version" entry in your Add-In's
registry (the same place where you set things such as LoadOnStartUp,
SupportedSoftwareVersionEqualTo, etc. Just increment the value of the
Version entry to 1 (and 2,3,4,.... for each time you want to change the way
your user interface looks).
Here's a link to the full discussion thread:
Here's the Registry file I'm currently using and it seems to be working just fine:
REGEDIT4
[HKEY_CLASSES_ROOT\CLSID\{57E6E593-2CAE-4016-AE01-74BB752C670E}]
@="SolidCAD ToolBox"
[HKEY_CLASSES_ROOT\CLSID\{57E6E593-2CAE-4016-AE01-74BB752C670E}\Description]
@="A collection of useful routines supplied by SolidCAD Inc."
[HKEY_CLASSES_ROOT\CLSID\{57E6E593-2CAE-4016-AE01-74BB752C670E}\Implemented Categories\{39AD2B5C-7A29-11D6-8E0A-0010B541CAA8}]
[HKEY_CLASSES_ROOT\CLSID\{57E6E593-2CAE-4016-AE01-74BB752C670E}\Required Categories]
[HKEY_CLASSES_ROOT\CLSID\{57E6E593-2CAE-4016-AE01-74BB752C670E}\Required Categories\{E357129B-DB40-11D2-B783-0060B0F159EF}]
[HKEY_CLASSES_ROOT\CLSID\{57E6E593-2CAE-4016-AE01-74BB752C670E}\Settings]
"LoadOnStartUp"="1"
"Type"="Standard"
"Version"="10"
"SupportedSoftwareVersionEqualTo"="10.."
You're really missing out on a great resource if you haven't checked out the Autodesk Discussion Groups.
Thanks again Sanjay.