3 Replies Latest reply on Aug 19, 2015 9:11 AM by Jim Sculley

    Custom C# application failure on check in

    Shawn Pantzke

      I am writing an application to rename, move, checkout, update file card properties and then check a group of files in based on location. I have the bulk of the application working but when I go to check the files in I get an error "An attempt was made to access a file that is exclusively opened by another application". I am lost I have tried nulling the the vault and loging back in, but that will not work. ideas?

        • Re: Custom C# application failure on check in
          Lee CS Young

          How are you doing the file property updates? Use BatchUpdate.

            • Re: Custom C# application failure on check in
              Shawn Pantzke

              I am going to a folder and finding all files in the folder and the subfolders and making a list and recursively checking out, and updating. when all of the files are updated I use the same list to check the files in.


              I am not able to use batch update as based on file name the properties can vary, that and EPDM has an automatic transition in the workflow for this process that will not work with batch checkin, I have tried a few different ways and all of them have issues thus far.





            • Re: Custom C# application failure on check in
              Jim Sculley

              You can use Process Explorer to determine what process is holding the file.  If it is your own application, you are probably doing something wrong.  It's impossible to know without seeing some code.  Is SolidWorks open when you are doing this? Are any of the problem files open in SolidWorks?


              I have an add-in that does the same sort of thing (check out, update properties, check in, rename and move) and I use BatchUpdate and BatchUnlock.  BatchUpdate doesn't require that all the files get the same property changes.  You set variable values on a per file basis using SetVar.


              Jim S.