Hi,
I dont have any programming experiance so I'm hoping someone can help!
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
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