Vault Lifecycle State of model through drawing
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Good Afternoon Fellow Designers,
I came across the following code that extracts the vault lifecycle state of a part (.ipt) or assembly (.iam) from the model file.
AddReference "Autodesk.Connectivity.WebServices.dll"
Imports AWS = Autodesk.Connectivity.WebServices
AddReference "Autodesk.DataManagement.Client.Framework.Vault.dll"
Imports VDF = Autodesk.DataManagement.Client.Framework
AddReference "Connectivity.Application.VaultBase.dll"
Imports VB = Connectivity.Application.VaultBase
Dim mVltCon As VDF.Vault.Currency.Connections.Connection
mVltCon = VB.ConnectionManager.Instance.Connection
If mVltCon Is Nothing Then
Messagebox.Show("Not Logged In to Vault! - Login first and repeat executing this rule.")
Exit Sub
End If
Dim VaultPath As String = ThisDoc.PathAndFileName(True)
VaultPath = VaultPath.Replace("C:\$WorkingFolder\", "$/")
'flip the slashes
VaultPath = VaultPath.Replace("\", "/")
Dim VaultPaths() As String = New String() {VaultPath}
Dim wsFiels() As AWS.File = mVltCon.WebServiceManager.DocumentService.FindLatestFilesByPaths(VaultPaths)
Dim mFileIt As VDF.Vault.Currency.Entities.FileIteration = New VDF.Vault.Currency.Entities.FileIteration(conn,wsFiels(0))
Dim lifeCycleInfo As VDF.Vault.Currency.Entities.FileLifecycleInfo = mFileIt.LifecycleInfo
Messagebox.Show(lifeCycleInfo.Statename)
Source: Connecting vault and accessing vault file status through Inventor iLogic
Could one of my fellow coder's tell me how to modify this code so that I can see the state of the model from the drawing file?
Thank you
Regards,
Edward