1 Reply Latest reply on Aug 17, 2018 6:56 AM by Jack Brooker

    PDM API - Searching, and getting & replacing references

    Jack Brooker

      Hi all


      Pretty new to using the Solidworks API - trying to get my head around stuff

      Not looking for somebody to do this for me, I want to learn - I'm looking for advice on how to create a standalone application which does this:


      1. Select a part in PDM, and get all associated sub-references
      2. For each reference, check if it is broken or lost. If it is then -
      3. Cut down reference path to the string, and search specific locations (or the entire vault) for that filename
      4. List returned files, and select one based on specific criteria (Search filename for most up to date revision)
      5. If it is able to do this successfully, automatically replace the reference with this part
      6. If it cannot, save the search results for later
      7. Once it has run through each part, go through and list each reference, and what it is being replaced with. For references it was unable to replace, get the search results list and allow the user to then select a returned value for each part, or leave the reference as broken.


      Again - not looking for somebody to do this for me, but looking for advice on what the best methods would be to handle this task. I have experience with VBA & VB.NET so this is what i'm using to program it.


      Currently I am looking into these to try and learn and understand how the API works for my uses:



      Any other help would be greatly appreciated



        • Re: PDM API - Searching, and getting & replacing references
          Jack Brooker

          An update if anybody can help - i've gotten well underway with it and I now have a program which allows you to select parts & grab their references. It will then search for the parts within the vault, looking for certain criteria, then it adds all of its information to a datagridview.


          Whats the best way to go about then updating my file references from the datagridview? I'm thinking of somehow using the IEdmReference11interface with the SetFullPath method - but I can't figure out how to select a file with this interface. Ideally i'd like to be able to select the Reference using the Parent file and reference ID/referenced filepath, then replace it with the search query.


          What would be the best way to go about this?