11 Replies Latest reply on Dec 22, 2015 2:55 PM by S. Casale

    ePDM - button on filecard to open PDF-file

    Peter Larsen

      Hi,

       

      I am trying to find the right approach to quickly open PDF-files made from SW drawings.

       

      I will soon be introducing a "Part Browser" for our sales crew where they will be using an ePDM search card that contains many CustomProperties based on ASM and part files.

      The making of the PDF-files are done semi-automatic and can be placed in any specific folder so that´s all good.

       

      But since the PDF do not contain the properties from PDM they will not show up in the search list unless they search for the filename itsef.

       

      So the question is if you can make an action button on the PDM File Card that opens the PDF with the same filename located in the same folder or specific folder:

      E.g.   "Open file: file-location of SW-file\file-name of SW-file.PDF"

       

      I know about the ability to reference a file to a SW-file in PDM but not sure it can be done quickly since we have a lot files...

       

      Will I need to run an Add-in like shown below?

      I am not into programming but would it be an easy task?

       

      Thanks in advance.

       

      Regards

      Peter

        • Re: ePDM - button on filecard to open PDF-file
          Mike Gann

          Hi Peter -

           

          Did you ever get this figured out?

           

          We have this implemented in our system and it works well. Let me know if I can help.

            • Re: ePDM - button on filecard to open PDF-file
              Peter Larsen

              Hi Mike,

              Thanks for the reply - looks very interesting!

              I recently started again to look into this task creating a "Part Browser" but I do not know how to create this button.

               

              Can you tell me how to do it?

               

              Thanks in advance.

               

              /Peter

                • Re: ePDM - button on filecard to open PDF-file
                  Mike Gann

                  Hi Peter -

                   

                  You will need an add in. Mine is written in Visual Basic. If you can work with Visual Basic I can send you my add in and you can modify it to work with your system. Mine currently is probably a little more complicated than you need as we have two locations (one in the US and one in Europe) so I need to determine where the user is located as we have PDF's stored locally for each site. I also take different actions depending on a file card variable we use named status, which indicates if the drawing is a draft, released or under editing.

                   

                  If you aren't familiar with Visual Basic, I may be able to modify it for you and just send you the compiled add in.

                   

                  Can you give me an example of the following for one of your parts?

                   

                  1. Solidworks model file name

                  2. Solidworks drawing file name

                  3. PDF file name

                  4. The network path where your PDF files are stored

                   

                  To create the button:

                   

                  1. In the card editor, place a button on the card.

                  2. Set the button properties similar to this:

                  3. Give the button a caption.

                  4. Set the Command type to Run Add-in

                  5. Enter a value in the "Name of Add-in" field. This is not actually the name of the add in, but the text in this box can be checked in your add-in to determine if your button was the one that was pushed.

                  6. Create an Add-in that is hooked to a file card button.

                  7. When a file card button is pressed (any file card button) your add-in will run.

                  8. When your add-in runs, you can check the the text entered in the "Name of add-in" from step 5 above, to determine if your button was the one that was pressed. For example I check the first 7 characters to see if they equal "OpenPdf" and if they do then my Add-in proceeds. If they don't, then my "Open PDF" button was not the one that was pressed and my Add-in exits with no action taken.

                  If my button was pressed, then in my system I need to build the PDF file name from variables on the data card because our PDF's include the revisions in the file name and our SolidWorks files do not. I then open the PDF.

                   

                  Best regards,

                   

                  Mike

                    • Re: ePDM - button on filecard to open PDF-file
                      Peter Larsen

                      Hi Mike,

                       

                      Thanks for the fine description of your add-in. Unfortunately, I know very little about Visual Basic so I cannot work on my own in this language or any other programming language for that matter - but I want to learn it. It must be great to solve problems like this on your own!

                       

                      If you have the time to see if you can modify the add-in for me I will appreciate it a lot. Yes, mine should be a bit more simplier than yours.

                      An example could be:

                      1.     SP2-2101-0300.sldasm

                      2.     SP2-2101-0300.slddrw

                      3.     SP2-2101-0300.pdf

                      4.     Network path - one of two options (have not decided yet):

                                   a. Same location as the specific model/drawing

                                   b. C:\ESM CAD 2\PDF Storage

                       

                      Just for the sake of curiosity you could also send me your working add-in for me to inspect. I might learn something ;)

                       

                      Thanks in advance.

                       

                      Kind regards

                      Peter

                        • Re: ePDM - button on filecard to open PDF-file
                          Cad Admin

                          Mike,

                           

                          Saw your post. I'm looking to do something similar.  basicly opening a PDF from the datacard, the PDF file will have the exact same name as the SolidWorks one.  Pretty simple, but i lack in the programming sense...was wondering if you could fwd me a copy of your add-on to test?

                           

                          Also would it be possible to code in an additional sub-folder.  My boss like to keep the pdfs in a sub-folders, but the structure will always remain the same...

                           

                          example \jobs\12345\Released PDF\

                           

                          every Job number "12345" will have a "released PDF" subfolder.

                           

                          This is on their wish list, i currently have them filed in the SAME directory, but if i can get it in the sub-folder, that would be awesome.

                        • Re: ePDM - button on filecard to open PDF-file
                          Cad Admin

                          Mike,

                           

                          Saw your post. I'm looking to do something similar.  basicly opening a PDF from the datacard, the PDF file will have the exact same name as the SolidWorks one.  Pretty simple, but i lack in the programming sense...was wondering if you could fwd me a copy of your add-on to test?

                           

                          Also would it be possible to code in an additional sub-folder.  My boss like to keep the pdfs in a sub-folders, but the structure will always remain the same...

                           

                          example \jobs\12345\Released PDF\

                           

                          every Job number "12345" will have a "released PDF" subfolder.

                           

                          This is on their wish list, i currently have them filed in the SAME directory, but if i can get it in the sub-folder, that would be awesome.

                    • Re: ePDM - button on filecard to open PDF-file
                      Adrian Velazquez

                      Peter,

                       

                      How are you creating the PDF exactly?  The reason I ask is because with the EPDM Task engine is very simple to create the PDFs automatically and push Variable values to them based on the Variable of the SW Drawing; you can also attach them to it's parent SW Drawing automatically.

                        • Re: ePDM - button on filecard to open PDF-file
                          Peter Larsen

                          Hi Adrian,

                           

                          I have just recently looked at the ePDM task engine and it looks quite simple, yes.

                           

                          I make the PDF´s using CustomTools (Print and Convert).

                          It has some advantages e.g. if you want to make one merged PDF of all drawings in an assembly with specific sheet names. Is ePDM task engine able to do that? Or is it only one drawing at a time?

                           

                          Sounds very interesting adding variables to the PDF but all our variables are attached to the model and not the drawing. Is there a way to solve this?

                          Can you run the task on the models but actually make the PDF from the drawing?

                          (I could add the task to a PDM state transition but I would like the models and PDF´s only to go through this transition since our sales people should only have access to models & PDF´s and not the drawings).

                           

                          Thanks in advance.

                           

                          Kind regards

                          Peter

                        • Re: ePDM - button on filecard to open PDF-file
                          Cad Admin

                          Peter,

                           

                          Did you ever get this to work, i've been trying to do something similar.  Did Mike ever get you a copy of his addin?

                          • Re: ePDM - button on filecard to open PDF-file
                            S. Casale

                            When I use the preview tab in the preview pane, the pdf opens automatically for me without issue.