Message 1 of 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi!
I'm debugging some stuff. Turns out; some user doesn't have the latest version of the iLogic Rule he uses.
I'm looking to get some snippet where I can get a boolean out or a local version number I can compare to the Vault version.
This is what I have now:
' Function that returns the property value for any Vault File (input is "C:/....../file.ext")
Function VaultProperty(oPropertyName As String, FullFileName As String) VaultPath = FullFileName.Replace("C:\Workspace\", "$/") VaultPath = VaultPath.Replace("\", "/") Dim VaultPaths() As String = New String() {VaultPath } Dim wsFiels() As AWS.File = mVltCon.WebServiceManager.DocumentService.FindLatestFilesByPaths(VaultPaths) 'Ts file exists in the Vault. Dim FileIt As VDF.Vault.Currency.Entities.FileIteration = New VDF.Vault.Currency.Entities.FileIteration(mVltCon, wsFiels(0)) If (PropDefDict.TryGetValue(oPropertyName, definition)) oPropertyValue = mVltCon.PropertyManager.GetPropertyValue(FileIt, definition, Nothing) End If Return oPropertyValue End Function
You need to declare some stuff in the header and class:
In header
Imports VDF = Autodesk.DataManagement.Client.Framework Imports ACW = Autodesk.Connectivity.WebServices Imports AWS = Autodesk.Connectivity.WebServices Imports VB = Connectivity.Application.VaultBase Imports Autodesk.DataManagement.Client.Framework.Vault.Currency.Properties AddReference "Connectivity.Application.VaultBase.dll" AddReference "Autodesk.Connectivity.WebServices.dll" AddReference "Autodesk.DataManagement.Client.Framework.Vault"
in class:
Shared Dim mVltCon As VDF.Vault.Currency.Connections.Connection Shared Dim PropDefDict As PropertyDefinitionDictionary Private vaultAddinID As String = "{48B682BC-42E6-4953-84C5-3D253B52E77B}" Private vaultAddin As ApplicationAddIn
In Main()
mVltCon = VB.ConnectionManager.Instance.Connection PropDefDict = mVltCon.PropertyManager.GetPropertyDefinitions(VDF.Vault.Currency.Entities.EntityClassIds.Files, Nothing, PropertyDefinitionFilter.IncludeAll) iLogicRuleFile = "C:\Workspace\...\File.iLogicVb" oVersionNumber = (VaultProperty("VersionNumber",iLogicRuleFile))
Any tips on how to get the local version number OR any other way to see if the file is out of date?
Did you find this reply helpful ? If so please use the Accept as Solution or Kudos button below.
___________________________Solved! Go to Solution.