In this post i will describe step by step how you can create your first extension for Autodesk Vault 2022.
First of all if you want to extend Vault you will need at least Workgroup, Collaboration or Professional version.
In this tutorial i will work with Vault Professional 2022.
1. Create class library project with .NET Framework 4.7.2
- Open Visual Studio 2019
- File -> New -> Project
- Choose “Class Library (.NET Framework)”
- Set project name for example “JasinskiDev.FirstVaultExtension”
- Set Framework to 4.7.2 (It may works on other .NET Frameworks, but I have it tested on 4.7.2)
2. Add references to created project
You need to add references to libraries below. You can get them by installing SDK provided with Autodesk Vault 2022.
- Autodesk.Connectivity.Extensibility.Framework
- Autodesk.Connectivity.Explorer.Extensibility
After adding references to Vault libraries you should set their property “Copy Local” to false.
3. Edit properties of created project
- Go to properties of your created project.
- Go to build tab and set output path to Vault extensions folder.
For example: “C:\ProgramData\Autodesk\Vault 2022\Extensions\JasinskiDev.FirstVaultExtension” - Go to debug and set “Start external program” to your Vault executable path.
For example: “C:\Program Files\Autodesk\Vault Client 2022\Explorer\Connectivity.VaultPro.exe” - Save changes.
4. Create public class inside project you created and implement IExplorerExtension interface.
- Create new public class called for example for example “ExplorerExtension”.
- Implement IExplorerExtension interface.
using Autodesk.Connectivity.Explorer.Extensibility;
using System.Collections.Generic;
using System.Windows.Forms;
namespace JasinskiDev.FirstVaultExtension
{
public class ExplorerExtension : IExplorerExtension
{
public IEnumerable<CommandSite> CommandSites()
{
return new List<CommandSite>();
}
public IEnumerable<DetailPaneTab> DetailTabs()
{
return new List<DetailPaneTab>();
}
public IEnumerable<CustomEntityHandler> CustomEntityHandlers()
{
return new List<CustomEntityHandler>();
}
public IEnumerable<string> HiddenCommands()
{
return new List<string>();
}
public void OnStartup(IApplication application)
{
MessageBox.Show("Hello World");
}
public void OnShutdown(IApplication application)
{
}
public void OnLogOn(IApplication application)
{
}
public void OnLogOff(IApplication application)
{
}
}
}
5. Create .vcet.config file
This file tells the Vault extensions framework how to load your extension.
After creating file set its property “Copy to Output Directory” to “Copy if newer”.
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<connectivity.ExtensionSettings3>
<extension
interface="Autodesk.Connectivity.Explorer.Extensibility.IExplorerExtension, Autodesk.Connectivity.Explorer.Extensibility, Version=27.0.0.0, Culture=neutral, PublicKeyToken=215b0879a7566597"
type="JasinskiDev.FirstVaultExtension.ExplorerExtension, JasinskiDev.FirstVaultExtension">
</extension>
</connectivity.ExtensionSettings3>
</configuration>
6. Edit AssemblyInfo
You need to edit AssemblyInfo like in example below.
- AssemblyDescription, AssemblyCompany, AssemblyProduct – Fill those how you want, cannot be empty.
- ExtensionId – Just copy auto generated GUID of your project, need to be unique among all extensions.
- ApiVersion – API Schema version, to work with Vault 2022 set it to “15.0”.
using Autodesk.Connectivity.Extensibility.Framework;
using System.Reflection;
using System.Runtime.InteropServices;
[assembly: AssemblyTitle("JasinskiDev.FirstVaultExtension")]
[assembly: AssemblyDescription("My first Vault Extension")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("JasinskiDev")]
[assembly: AssemblyProduct("JasinskiDev.FirstVaultExtension")]
[assembly: AssemblyCopyright("Copyright © 2021")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
[assembly: Guid("fdba03f1-5ad6-47da-a390-0f38366551a1")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: ExtensionId("fdba03f1-5ad6-47da-a390-0f38366551a1")]
[assembly: ApiVersion("15.0")]
That’s all you need.
After that you can just click Start button in Visual Studio.
You should see (in this case) message box with text “Hello world” on Vault Professional 2022 startup.
Notice that It may appear under Vault splash screen.