List all vault views using SOLIDWORKS PDM API

Edit ArticleEdit Article
Comments

Vault views info printed to Console window
Vault views info printed to Console window

This example demonstrates how to list all available vault views and their paths and prints the information to the console window.

IEdmVault8::GetVaultViews SOLIDWORKS PDM API is used to list the information about all available PDM vaults. Alternatively this information can be retrieved from the Registry.

using EPDM.Interop.epdm;
using System;

namespace CodeStack.ListPdmVaults
{
    class Program
    {
        static void Main(string[] args)
        {
            var vault = new EdmVault5Class();
            EdmViewInfo[] views;
            vault.GetVaultViews(out views, false);

            foreach (var view in views)
            {
                Console.WriteLine($"{view.mbsVaultName}:{view.mbsPath}");
            }
        }
    }
}

Notifications

All articles and code at CodeStack are now open-source and hosted on GitHub. If you want to contribute by modifying existing articles and code snippets, submitting new ones, reporting errors and bugs etc. please follow this blog post for more information. We appreciate any contribution.


Product of Xarial Product of Xarial