VDS per Vault?

VDS per Vault?

mchi_topsoe
Enthusiast Enthusiast
632 Views
5 Replies
Message 1 of 6

VDS per Vault?

mchi_topsoe
Enthusiast
Enthusiast

Getting into the Vault Data Standard (VDS). Very powerful extension!

Can I make the menudefinitions.xml Vault specific?

 

We have different setups for different vaults. (Different properties). I want to push the same configuration to all users.

0 Likes
Accepted solutions (1)
633 Views
5 Replies
  • VDS
Replies (5)
Message 2 of 6

Markus.Koechl
Autodesk
Autodesk
Accepted solution

You cannot switch configurations per login, as the configuration loads during start-up. However, you can evaluate the Vault name to switch your business logic within the scripts and UI (XAML) styles.



Markus Koechl

Solutions Engineer PDM, Autodesk Central Europe
0 Likes
Message 3 of 6

mchi_topsoe
Enthusiast
Enthusiast

ok, so the menu modifications will be the same for all users. 

 

I guess this is something for the Ideastation.

 

Thanks for the reply Markus. 

0 Likes
Message 4 of 6

Markus.Koechl
Autodesk
Autodesk

Yes, the menu definition applies to any Vault to which the user is logged in. You can submit an idea; however, I fear we cannot follow-up on this: the Vault Client would need a restart, as menu customizations are loaded during the application start-up. The problem is the order: the host (client application) starts and loads the VDS add-in with all its configuration parts (including the menu definition, as the client needs this information during start-up). The user logs in, and with that, the selection of a Vault.



Markus Koechl

Solutions Engineer PDM, Autodesk Central Europe
0 Likes
Message 5 of 6

mchi_topsoe
Enthusiast
Enthusiast

Thanks for explaining - that makes sense.

 

So we can add the menu item, and do the validation in the script upon execution.

 

/Michael

 

0 Likes
Message 6 of 6

Nick_Hall
Collaborator
Collaborator

Hi Michael

 

I read @Markus.Koechl's notes about this and that makes complete sense, but if you would like a separate menu definitions file for each Vault, and are interested in an off-the-wall idea, here's one for you. 

 

  • Store the MenuDefinitions.xml in the same place in each Vault, say $/Configuration/VDS/MenuDefinitions.xml
  • Create a small add-in that captures the OnLogOn event
  • In the event handler you can
    • Check for C:\ProgramData\Autodesk\Vault 2025\Extensions\DataStandard\Vault.Custom\MenuDefinitions.xml
    • Calculate the checksum for that file - https://adndevblog.typepad.com/manufacturing/2012/07/how-to-calculate-checksum.html
    • Compare that with the checksum of the current version of $/Configuration/VDS/MenuDefinitions.xml ( the CkSum property of the file)
    • If it matches, VDS is configured for that Vault
    • If it doesn't match
      • Download $/Configuration/VDS/MenuDefinitions.xml
      • Copy it to C:\ProgramData\Autodesk\Vault 2025\Extensions\DataStandard\Vault.Custom
      • Get the details of the running instance of Vault Pro
      • Start a new instance of Vault Pro, which will then use the correct MenuDefinitions.xml
      • Kill the running instance

This code shows how to kill Vault Pro from an add-in

public void OnLogOn(IApplication application)
{
    System.Diagnostics.Process nProcess = System.Diagnostics.Process.GetCurrentProcess();
    int nProcessID = nProcess.Id;
    string sProcessName = System.Diagnostics.Process.GetCurrentProcess().ProcessName;
    DialogResult res = MessageBox.Show("Hello World Extension loaded by process " + sProcessName + " with ID " + nProcessID.ToString() + " Close (Y/N)", "Close", MessageBoxButtons.YesNo);
    if (res == DialogResult.Yes)
    {
        nProcess.Kill();
    }
}


Hope that's of interest.

Nick

0 Likes