Brian has a very detailed article on Reference Keys (exposed through the ReferenceKeyManager object) and as I was playing with them I thought it could be useful to have a tool for that.
So I created an add-in that lets you create Key Contexts and Reference Keys for the various objects, and binding them back to objects in the model.
When switching between documents, it also stores/loads data to/from json files named based on the Document‘s DisplayName plus “.json” as extension, .e.g. “Boxes.iam.json”
They will be saved in the same folder as the add-in‘s dll and their content will look like this:
{
"contexts": {
"Default": {
"index": 0,
"keys": [
"AgEBAAQAAAADAAAA"
]
},
"AgAAAAEAAAA=": {
"index": 1,
"keys": [
"AgEBAAQAAAACAAAA",
"AgEBAAQAAAADAAAA",
"AgEBAAQAAAAGAAAA"
]
}
}
}
Here is the add-in’s form:
As I was looking for icons I ran into the Visual Studio Image Library which can be downloaded from the Microsoft website:
https://www.microsoft.com/en-us/download/confirmation.aspx?id=35825
Here is the source code of the project: https://github.com/adamenagy/ReferenceKeyManager
I modified the Project settings so that the Output folder will always be the correct location for loading the add-in in Inventor:
%AppData%AutodeskApplicationPluginsReferenceKeyManager
The way to do that is open the csproj file in a text editor and then you can use special variables like $(AppData) in the <OutputPath>:
<OutputPath>$(AppData)AutodeskApplicationPluginsReferenceKeyManager</OutputPath>
-Adam


Leave a Reply