Message 1 of 1
Vault API – ERROR 109 when checking in a drawing while the referenced model is checked out
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi everyone,
I’m running into an issue with the Autodesk Vault API when trying to check in a drawing file (.idw).
If the referenced model (.ipt / .iam) used on that drawing is checked out, I always get this error:
It seems that Vault is blocking the drawing check-in because one of its dependencies (the model) is checked out or out of date.
Has anyone encountered this issue and found a way to check in a drawing even when the referenced model is checked out?
public void UpdateFile(Connection vaultConn, DrawingDocument drawingDocument, ACW.File drawingFile, FileAcquisitionResult fileResult)
{
Stream fileCont = new FileStream(drawingDocument.FullFileName, FileMode.Open, FileAccess.Read);
byte[] fileContents = new byte[fileCont.Length];
//ByteArray uploadTicket = UploadFileResource(vaultConn.WebServiceManager, drawingDocument.FullFileName, fileContents);
FileAssocArray[] drawAssoc = vaultConn.WebServiceManager.DocumentService
.GetLatestFileAssociationsByMasterIds(new long[] { drawingFile.MasterId },
FileAssociationTypeEnum.None,
false,
FileAssociationTypeEnum.Dependency,
false,
false,
false,
false);
List<ACW.FileAssocParam> mFileAssocParams = new List<ACW.FileAssocParam>();
if (drawAssoc.FirstOrDefault().FileAssocs != null)
{
foreach (ACW.FileAssoc item in drawAssoc.FirstOrDefault().FileAssocs)
{
ACW.FileAssocParam mFileAssocParam = new ACW.FileAssocParam();
mFileAssocParam.CldFileId = item.CldFile.Id;
mFileAssocParam.ExpectedVaultPath = item.ExpectedVaultPath;
mFileAssocParam.RefId = item.RefId;
mFileAssocParam.Source = item.Source;
mFileAssocParam.Typ = item.Typ;
mFileAssocParams.Add(mFileAssocParam);
}
}
string localPath = drawingDocument.FullDocumentName;
drawingDocument.Close();
FileIteration mUploadedFile = vaultConn.FileManager.CheckinFile(fileResult.File,
"Aktualizacja styli",
false,
mFileAssocParams.ToArray(),
null,
false,
null,
ACW.FileClassification.DesignDocument,
false,
fileResult.LocalPath);
fileCont.Dispose();
fileCont.Close();
if (System.IO.File.Exists(localPath))
{
System.IO.FileInfo fileInfo = new FileInfo(localPath);
fileInfo.IsReadOnly = false;
fileInfo.Delete();
}
}
If you found it helpful, a "Like" would be much appreciated!
If this post solved your problem, please mark it as "Solution.".
If this post solved your problem, please mark it as "Solution.".