Community
Vault Customization
Share your knowledge, ask questions, and explore popular Vault API, Data Standard, and VBA topics related to programming, creating add-ins, or working with the Vault API.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Change Revision Scheme during state transition

1 REPLY 1
Reply
Message 1 of 2
stuarts
346 Views, 1 Reply

Change Revision Scheme during state transition

Hi,

 

I dont have any programming experiance so I'm hoping someone can help! Smiley Happy

I am looking at trying to automate a change of revision scheme based on a state change i.e. when i change from state approval to released the revision needs to change from alpha revison to numberical. I would like this to occur automatically rather than having to change the revision manually. 

 

Any help on this would be great!

 

Thanks

 

Stuart

1 REPLY 1
Message 2 of 2
Balaji_07
in reply to: stuarts

Hi Stuarts,

 

          Refer the RestrictOperations sample usually found in "C:\Program Files (x86)\Autodesk\Autodesk Vault 2014 SDK\VS10\CSharp\" If you have not installed the SDK then Install the SDK correspoinding to your vault version.

 

          In that Sample "EventHandlers.cs" is the file where you have to work with.

 

           Instead of

DocumentServiceExtensions.UpdateFileLifecycleStateEvents.GetRestrictions += new EventHandler<UpdateFileLifeCycleStateCommandEventArgs>(UpdateFileLifecycleStateEvents_GetRestrictions);

 

use

 

DocumentServiceExtensions.UpdateFileLifecycleStateEvents.Post event

 

          You can get the Change the Revision Definition Id using below code(but the login used should have rights to do the changes)

 

long fileMasterId = ((Autodesk.Connectivity.WebServices.UpdateFileLifeCycleStateCommandEventArgs)e).FileMasterIds[0];

CurrentCredentials = new WebServiceCredentials((IWebService)(sender));
ServiceManager = new WebServiceManager(CurrentCredentials);

Autodesk.Connectivity.WebServices.File _file = ServiceManager.DocumentService.GetLatestFileByMasterId(fileMasterId);

_file.FileRev.RevDefId = "Your Revision Scheme Id"

 

Thanks,

Balaji A

 

          

 

          

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report