Message 1 of 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I would like to have dialog box asking the user if they would like to release their drawing, if it's not already so, upon exit. I can read the current lifecycle state of the Vaulted drawing but I can't change it as it's a read-only property. How would I do this?
Imports Autodesk.DataManagement.Client.Framework.Vault Imports Autodesk.Connectivity.WebServices 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 AddReference "Autodesk.DataManagement.Client.Framework.Vault.dll" AddReference "Autodesk.DataManagement.Client.Framework.dll" AddReference "Connectivity.Application.VaultBase.dll" AddReference "Autodesk.Connectivity.WebServices.dll"
Dim oFilePath As String = ThisDoc.Document.FullDocumentName Dim oVaultConnection As VDF.Vault.Currency.Connections.Connection oVaultConnection = VB.ConnectionManager.Instance.Connection If oVaultConnection Is Nothing Then MessageBox.Show("Not Logged In to Vault! - Login first and repeat executing this rule.") Exit Sub End If VaultPath = oFilePath.Replace("C:\VaultWS\", "$/") VaultPath = VaultPath.Replace("\", "/") Dim VaultPaths() As String = New String() {VaultPath } Dim wsFiels() As AWS.File = oVaultConnection.WebServiceManager.DocumentService.FindLatestFilesByPaths(VaultPaths) Dim mFileIt As VDF.Vault.Currency.Entities.FileIteration = New VDF.Vault.Currency.Entities.FileIteration(oVaultConnection, wsFiels(0)) If mFileIt.LifecycleInfo.StateId = 22 Then '22 = released Logger.Info("Drawing already released. Exiting rule.") Return End If If mFileIt.IsCheckedOut = True Then Logger.Info("Drawing checked out. Drawing must be checked in to release. Exiting rule.") Return End If MessageBox.Show("You are exiting a checked in, WIP drawing. Would you like to release?", "Release?", MessageBoxButtons.YesNo, MessageBoxIcon.Question) If result = DialogResult.Yes Then ' Change the lifecycle state to "Released" Else Return End If
Solved! Go to Solution.