3 Replies Latest reply on Jul 23, 2014 10:15 AM by Dan Miel

    WPDM API - Get Documents very slow

    Sascha Smolny

      Hallo,

       

      i want to write a Macro to clean up my Working Directory.

      For that i must get all file informations (about  12.000 files) from vault.

       

      In the API-Example i can get the documents via:

       

       

      Dim allDocs As PDMWorks.IPDMWDocuments

      allDocs = con.Documents

       

       

       

      It takes about 7 minutes before i can start.

       

      I can get all the Documents individually from the vault:

       

      Dim TDoc As PDMWorks.PDMWDocument

      TDoc = con.GetSpecificDocument(file.Name)

       

       

      But this is also very slow and takes over one hour by my files.

      It is all very much slower than the SolidWorks function "My SolidWorks Workgroup PDM cleanup".

      I only need the UpdateStamp, Revision and DateModified. Is there another way?

      Regards,

      Sascha

        • Re: WPDM API - Get Documents very slow
          Dan Miel

          If you want just the documents from you project folder try using

            

          Dim allDocs As PDMWorks.IPDMWDocuments

           

          allDocs = con.Documents(ProjectName)

          If i remember right this should get just the docs in on project instead of the entire vault.

           

          Dan Miel

          SW 2014 SP03

            • Re: WPDM API - Get Documents very slow
              Sascha Smolny

              Thanks for the answer.

               

              Yes. This is faster if i need only one Project. But i need many Documents from Different Projects to get the information.

               

              I have 12.000 files in my Working-Forlder. If i open this folder in the Taskpane (File-Explorer) SolidWorks only need a minute to open it and Display the File Status:

              Datei-Explorer.PNG

               

              Is there an other Way to get the statuses? In the Document-Manager API i could not find anything.

               

              Regards,

              Sascha

                • Re: WPDM API - Get Documents very slow
                  Dan Miel

                  If you can select the files you want to work on by document name you might use IPDMWconnection.documentlist to retrieve just the names of the files in the vault. This just takes a few seconds. You would then need to loop through the names to select the files you want and get each document using GetSpecificDocument(DocName). Looping through the file names is fast.

                  If it is taking an hour to get the information you need I would write the info to an Excel file and read that as an array in your program.

                   

                  Dan