8 Replies Latest reply on Oct 10, 2018 9:45 AM by David Mandl

    epdm environment variable

    Damir Galic

      Hi,

      is it possible for epdm admin to set environment variable on all host PCs? With that I mean drive letter %EPDM% = C or full drectory to EPDM?

        • Re: epdm environment variable
          Jim Sculley

          Why do you think you need to do this?  Typically all EPDM operations are unaware of what drive the local view is installed on.

            • Re: epdm environment variable
              Damir Galic

              I would need this for referencing in my excel.

                • Re: epdm environment variable
                  Sam Sam

                  Hi,

                  I once tried to use the environment variables in VBA SolidWorks macro.

                  I do not remember why, but at me it did not turn out.

                  Perhaps because I wanted to place a macro in PDM. And maybe for other reason.

                   

                  There can be what you want to make has alternative or ready solution in PDM?

                  • Re: epdm environment variable
                    David Mandl

                    What, specifically are you trying to do?  If you're looking to create a hyperlink to a document in PDM, then you should probably read this:

                     

                    Graphics Systems' SolidNotes: How to Use Enterprise PDM's Smart Hyperlinks in Other Applications

                     

                    Only thing you'd need to be able to do is to query your PDM database to find the IDs for the Project (folder) and Document.

                      • Re: epdm environment variable
                        Damir Galic

                        In excel file I am trying to reference from another excel file that's on EPDM. But the fist excel file is also on epdm and it's used by everyone. However not everyone has the same EPDM path as other.

                        I think reading from registry is a solution. VBA seems to be able to do so.

                          • Re: epdm environment variable
                            David Mandl

                            In that case, it's actually much simpler than all that.

                             

                            Per that old blog post I linked (from my VAR days):

                            • Every PDM installation has that custom URL protocol installed on it
                            • The only difficulty in using those hyperlinks is finding the Project ID and the Document ID for any given file.  My recommendation:
                              • I'm not positive if you can link a SQL query to a card variable, if so:  do this.  Then your users can just look at a file card to get the values.  Maybe you can even just create the hyperlinks in your card, then you can copy/paste into your xlsx files from there?  I'd look into this if I still had access to PDM...
                              • Otherwise, just create an Excel File where you can customize a SQL query using cell values and distribute it to your team as a tool for creating hyperlinks URLs using the Conisio protocol.
                                • Let your users type in their file names (with extensions).  If the unique file name option is engaged in your PDM vault, that's all the information that they need to enter.  Otherwise, they would also need to copy + paste their folder path (without the root vault directory) to get the ProjectID.
                                • Your PDM database will have three tables that are worth searching in:
                                  • dbo.Documents  (Correlates file name- with extension- and the Document ID field)
                                  • dbo.Projects (Correlates a folder path with its Project ID field)
                                  • dbo.DocumentsInProjects (lists every Document ID and which Project ID it is stored in)
                                • Specific Queries worth using (its very basic, would need refinement if you don't have the unique file names option engaged in PDM):
                                  • DocID = SELECT min [DocumentID] FROM [Documents] WHERE [Filename] = 'filename.xlsx'
                                  • ProjID = SELECT DISTINCT [ProjectID] FROM [DocumentsInProjects] WHERE [DocumentID] = DocID ORDER BY [ProjectID] ASC
                                • Once you know the DocID and ProjectID for any given file, it's easy enough to use excel to concatenate the URL string per the blog post.
                    • Re: epdm environment variable
                      Scott Stuart

                      You can get the path to the vault root from the registry if you want:

                      HKLM\SOFTWARE\SolidWorks\Applications\PDMWorks Enterprise\Databases\<database name>\ShellRoot

                       

                      Alternatively, you can use the PDM API method RootFolderPath.