5 Replies Latest reply on May 3, 2018 9:42 PM by Amen Allah Jlili

    Does Solidworks PDM include API?

    Eric Snyder

      Does anybody know if files can be checked out and back in with the API in PDM (NOT EPDM)?

      IF so does anybody have any simple examples?

        • Re: Does Solidworks PDM include API?
          Cody Kirsch

          I think it is possible though I am not sure, and if it is to what extent the API is open for PDM. Are you planing on using something written in VBA or a .NET language? I think most of the functionality would not be supported for VBA.

           

          Depending on exactly what you want to accomplish, I'm pretty sure PDM just uses Windows' built in file permissions to control the read/wright access to the actual files. If you have direct access to the database where the PDM is storing the files you may be able to change the file attributes directly though I'm not sure how that would affect how they are seen by the PDM. If the checked in/out state is logged in the database you may be able to use a T-SQL script to change it, again assuming you have access to the server and database.You can also request Document Manager Key from SolidWorks API Support which can be used in by an application to access the metadata in the SW files directly if the checked in/out state of the file is managed there.

            • Re: Does Solidworks PDM include API?
              Eric Snyder

              I want to do something super simple. I want to create a list of a certain kind of file. Check them out one at a time, load the checked out file . Add a boundary box reference geometry. Save the file and check it in.

                • Re: Does Solidworks PDM include API?
                  Cody Kirsch

                  With what Christian said, that might not be a trivial task. We don't actually use PDM so I wouldn't be able to test anything, but if your able to make the effort, using a Document Manager Key it might be possible. It would have to be done in .NET for sure. If it wouldn't be an add in it would be extremely slow but just getting an add in to install and getting it set up in the registry can be tricky if your not familiar with how it works. Do you have access to general tech support with re-seller? SolidWork API Support could answer your question for sure but they can take weeks to respond to questions.

              • Re: Does Solidworks PDM include API?
                Christian Chu

                API is not included in the PDM standard package, only with PDM pro (new name for ePDM)

                • Re: Does Solidworks PDM include API?
                  Amen Allah Jlili

                  Eric,

                   

                  SOLIDWORKS PDM standard has no API support.
                  SOLIDWORKS PDM Professional (Formerly known as Enterprise PDM) has complete API support.

                  If you attempt to run an application that uses PDM API interop in a PDM standard environment, your application will throw a com exception with hresult of 0x800402F2 (E_EDM_STANDARD_APINOTSUPPORTED). Basically, this means the API is not supported in SOLIDWORKS PDM standard version if you look into this.

                   

                  The only way to check if a document is checked out is to check whether the Documents table's LockDate field is null or not in the PDM vault database. You can also check if the document is read-only but that's not reliable.

                   

                  Best,
                  Amen
                  www.cadsharp.com