Autodesk Vault Customization
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
change state on every file in vault
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
We have checked in a lot of files into vault professional but not every file has got the released state, is it possible to check for files in the vault with the extension "dwg" that has the state "work in progress" and set them all to released? does anybody know how do do this.
maybe somebody has a small code example they are willing to share.
regards
Kent boettger.
Solved! Go to Solution.
Re: change state on every file in vault
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
If you mean lifecycle state of the document then DocumentServiceExtensions.UpdateFileLifeCycleState
If the file is controlled by Item they you can release an item using ItemService.UpdateLifeCycleStates.

Jan Liska
Technical Consultant
Autodesk, Inc.
Re: change state on every file in vault
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
I cant figure this out? please help what is the problem in this my code.
i want to change my file from work in progress to released.
but i keep getting an error on the second last line of code :-(
For Each file As File In files
Dim MyfileName(0) As String
MyfileName(0) = "VAULT002.idw"
If file.Name = MyfileName(0) Then
'MsgBox(file.FileLfCyc.LfCycStateId.ToString)
m_listBox.Items.Add(parentFolder.FullName & "/" & file.Name & " - " & "FilID: " & file.Id & " - " & "FilMasterID: " & file.MasterId)
Dim ThisFileID As Long = file.Id
Dim ThisFileMasterID(0) As Long
ThisFileMasterID(0) = file.MasterId
'Lifecycle Definitions
'Name : Monsun Basic Release Process = 6
'Lifecycle States
'Work in Progress = LifecyclestateID 24
'For Review = LifecyclestateID 25
'Released = LifecyclestateID 26
'Obsolete = LifecyclestateID 27
Dim ThisFileLifecycleStateName As String = docSvc.GetFileById(ThisFileID).FileLfCyc.LfCycStat eName
Dim ThisFileLifeCyclestateID As Long = docSvc.GetFileById(ThisFileID).FileLfCyc.LfCycStat eId
Dim ThisFileLifeCycledefinitionID As Long = docSvc.GetFileById(ThisFileID).FileLfCyc.LfCycDefI d
MsgBox("LifecyclestateName: " & ThisFileLifecycleStateName & " - LifecyclestateID: " & ThisFileLifeCyclestateID & " - Lifecycledefinition: " & ThisFileLifeCycledefinitionID)
If file.FileLfCyc.LfCycStateId.ToString = "24" Then
Dim MyLyfeCycleState As Long() = New Long(System.Convert.ToInt64("Released")) {}
'MyLyfeCycleState(24) = System.Convert.ToInt64("Work in Progress")
'MyLyfeCycleState(25) = System.Convert.ToInt64("For Review")
'MyLyfeCycleState = System.Convert.ToInt64("Released")
'MyLyfeCycleState(27) = System.Convert.ToInt64("Obsolete")
'Dim Released As Long = System.Convert.ToInt64("26")
Dim docsvcExt As Autodesk.Connectivity.WebServices.DocumentServiceE xtensions
Dim Thisfile As File
Thisfile = docsvcExt.UpdateFileLifeCycleStates(ThisFileMaster ID, MyLyfeCycleState, "TEST RELEASE")
End If
Re: change state on every file in vault
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
What's the error code, please?
I see that you're using hardcoded ids for states - it's better to get state id from LfCycDef.StateArray.
There could be following issues:
- the code is setting same lifecycle state which is already set
- the code is setting state which doesn't belong to associated lifecycle definition
- the user doesn't have permission to change state

Jan Liska
Technical Consultant
Autodesk, Inc.

