I am new to Autodesk Vault Professional. I have a task to rename files that are stored in the database. There are around 2000 files and there is a pattern how the new name will look like. I have searched, googled on the net but did not find anything related except to use File Wizard to manually rename file one by one. I think it can be done through Vault API. Anyone has an experience or idea how to do it?
Asked
Active
Viewed 1,615 times
2 Answers
2
You need to check out the file (with FileManager.AcquireFiles
), then check in with a new filename (7th argument of FileManager.CheckinFile
, newFileName
)

Maxence
- 12,868
- 5
- 57
- 69
0
This doesn't seem to be working.
The checkinFile
function works until I enter a parameter for checkin name. When I do that it will generate an exception (exception 0) with no extra detail about the error.
This code generate error:
mainconnection.FileManager.CheckinFile(oFileIteration, Nothing, False,
New Autodesk.Connectivity.WebServices.FileAssocParam() {}, Nothing, False, "NewFileName.IPT",
Autodesk.Connectivity.WebServices.FileClassification.None, False,
Nothing)
But this one works:
mainconnection.FileManager.CheckinFile(oFileIteration, Nothing, False,
New Autodesk.Connectivity.WebServices.FileAssocParam() {}, Nothing, False, nothing,
Autodesk.Connectivity.WebServices.FileClassification.None, False,
Nothing)

Nathaniel Ford
- 20,545
- 20
- 91
- 102

Hamid
- 1
-
Be careful with `New Autodesk.Connectivity.WebServices.FileAssocParam() {}` in the `FileAssocParam()` parameter. You'll remove any file association by doing that in the check in method. For example an Inventor assembly file would not have references to its child parts and would cause an unresolved file reference error when opening the file in Inventor. You would also notice that nothing will show up in the "Uses" and "Where Used" tabs in Vault. – Fütemire Jul 13 '17 at 00:27
-
BTW Exception 0 is an `UnspecifiedSystemException`. Vault really only returns exception codes, I'm assuming to cut down on transferred data since Vault is all web based. However, you can find a whole list of the Server Error Codes and their descriptions in the Vault SDK help file. – Fütemire Jul 13 '17 at 00:37