Vault Lifecycle State of model through drawing

Vault Lifecycle State of model through drawing

Edward_Lowe
Enthusiast Enthusiast
1,702 Views
20 Replies
Message 1 of 21

Vault Lifecycle State of model through drawing

Edward_Lowe
Enthusiast
Enthusiast

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

By Chandra shekar Gopal

 

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

0 Likes
1,703 Views
20 Replies
Replies (20)
Message 21 of 21

prudhvi_galiFSSED
Participant
Participant

Hello 

 

I am actually looking for an Inventor iLogic script that can get the lifecycle state of a vault part. I could not find it on the internet.

I could only find a script that can get the lifecycle state of an 'item' on vault. I don't use items (yet). I just want it for regular parts and assemblies. 

Could someone please help me with that? 

 

Thank you in advance.

0 Likes