以前版本的插件向导会生成COM Registration代码,如下所示:
现在,从2012版本开始,插件向导将不再生成COM Registration代码,如下所示:
如何转换旧版本的插件(VB, C#, 和 C++)成为免注册插件,帮助文档有详细说明。查找register free就能找到。
现在,需要增加一个后缀为.addin 的文件。此文件定义了过去写入注册表的各种设置。文件名的格式为:Autodesk.AddInName.Inventor.addin (AddInName需要替换为你的插件名)
add-in dll 可以被放置在任何地方, 后缀为.addin 的文件必须放在指定位置,并记录add-in dll的路径。add-in dll的路径可以为绝对路径或相对路径。相对路径是相对于.addin文件的位置。
下面是.addin文件的示例:
<Addin Type="Standard">
<ClassId>{9c93ff52-e2fa-4ec4-8c4a-5747ad0bafef}</ClassId>
<ClientId>{9c93ff52-e2fa-4ec4-8c4a-5747ad0bafef}</ClientId>
<DisplayName>Attribute Helper</DisplayName>
<Description>Utility to help manage API attributes.</Description>
<Assembly>AttributeHelper.dll</Assembly>
<LoadOnStartUp>1</LoadOnStartUp>
<UserUnloadable>1</UserUnloadable>
<OSType>Win64</OSType>
<Hidden>0</Hidden>
<SupportedSoftwareVersionGreaterThan>15..</SupportedSoftwareVersionGreaterThan>
<DataVersion>1</DataVersion>
<UserInterfaceVersion>1</UserInterfaceVersion>
</Addin>
语言本地化的设置示例:
<Addin Type="Standard">
<ClassId>{9c93ff52-e2fa-4ec4-8c4a-5747ad0bafef}</ClassId>
<ClientId>{9c93ff52-e2fa-4ec4-8c4a-5747ad0bafef}</ClientId>
<DisplayName Language="1033">Attribute Helper</DisplayName>
<Description Language="1033">Utility to help manage API attributes.</Description>
<DisplayName Language="1036>Attribute Helper</DisplayName>
<Description Language="1036">L'utilité pour aider gère les attributs d'API.</Description>
……
.addin 文件的存放位置:
- 与版本无关
- Windows7/Vista:
- %APPDATA%\ Autodesk\Inventor Addins\
- Windows XP:
- %ALLUSERSPROFILE%\Application Data\Autodesk\Inventor Addins\
- 与版本有关
- Windows7/Vista:
- %APPDATA%\ Autodesk\Inventor 2012\Addins\
- Windows XP:
- %ALLUSERSPROFILE%\Application Data\Autodesk\Inventor 2012\Addins\
- 插件Just me安装
- Windows7/Vista & XP:
- %USERAPPDATA %\Roaming\Autodesk\Inventor 2012\Addins\
- App Store
- Windows7/Vista & XP:
- %APPDATA%\Autodesk\ApplicationPlugins