Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Remove reserved on assemblies without loading components

0 REPLIES 0
Reply
Message 1 of 1
laurence.roijackers
153 Views, 0 Replies

Remove reserved on assemblies without loading components

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.

Labels (3)
0 REPLIES 0

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

Post to forums  

Autodesk Design & Make Report