Hello,
We have a lot of assemblies from before we used Vault, these use the old system where someone could "reserve" a file.
The problem is some assemblies where never unreserved, but we want to add them to Vault.
But they have to be unreserved before they go into Vault.
Using apprentice (Inventor 2022.4.1) to go through folders looking for Inventor files and see if they need to unreserved does work.
Dim InfoArrayIam As IO.FileInfo() = MyDirectoryInfo.GetFiles("*.iam", IO.SearchOption.AllDirectories)
For Each MyInfo As IO.FileInfo In InfoArrayIam
On Error Resume Next
_apprentice.Open(MyInfo.FullName)
_Doc = _apprentice.Document
Dim WhoReservedMe As String = "None"
If _Doc.ReservedForWriteName <> "" Then
WhoReservedMe = _Doc.ReservedForWriteName
_Doc.ReservedForWriteByMe = True
_Doc.ReservedForWriteByMe = False
End If
The problem now is that I have to open the assembly, which means opening everything in it, which means it takes a very long time for larger assemblies to, essentially, run 2 lines of code that clear 1 iproperty.
Isn't there a better (faster) way of doing this?
I did look around but could not find a answer, for example a similar question is left unanswered here: https://forums.autodesk.com/t5/inventor-ilogic-and-vb-net-forum/inventor-2023-vba-changes-and-errors...
I did find some options to be used when opening a file: Documents_OpenWithOptions
But the best I could get from that is to open express mode, which as far as I know still looks around and loads the components in an assembly.