12 Replies Latest reply on Nov 24, 2017 11:55 AM by Stavros Pantelakis

    PDF Task Generation - PDF State

    Shawn Casebolt

      I have not been able to figure this out, but given the number of people who create PDF's of their released files, I would think that this has to be feasible.

       

      1) When transitioning a file from review to released, there is an action / task that auto generates the pdf.

      2) The problem is that the PDF file comes in as being "in design" as that is the initial state of the workflow.  It should be released, same as the slddrw......as releasing it is what generated the pdf in the first place

       

      The next issue then becomes putting the drawing on hold.  I have added pdf as a drawing node, so that when you state change the SLDDRW to on hold, you have the OPTION to change state on the pdf as well.  Ideally I want that to not be an option that someone could forget.......wherever the SLDDRW goes in the workflow, so does the PDF.  No questions, no thoughts, it just follows.

       

      Are these 2 things feasible?  Thank you in advance

        • Re: PDF Task Generation - PDF State
          Prasad Bhonsule

          Hi Shawn, with regards to your points:

           

          1) The PDF goes into "In Design" because the default behavior of the Convert Task is to check the file in after creation. Whenever a file is checked in for the first time it goes into the initial state of the workflow (In Design). The best way to get it to Released is to add a Automatic transition from In Design to Released and add a condition to only allow PDF files through

           

          2) As for the second point, there is no way to force referenced files through a transition (PDM will automatically select them) but people can always deselect them. A question I would ask is why you want to the PDF to go through the workflow as well? If the drawing is put on hold and then re-released etc the PDF will be recreated.

           

          Kind regards

           

          Prasad

          • Re: PDF Task Generation - PDF State
            Stavros Pantelakis

            Hello Shawn,

             

            I'm not sure there is a way to sync the states of the two files.  We have a workflow for approved pdf files which brings them in as 'approved'.  To get what you are looking for you could set up a dispatch function to move the pdf file to a folder inaccessible to purchasing when 'in design' and move it back and reprint when approved.  Alternatively you could delete the existing pdf on state transition back to 'in design'.

             

            I'm thinking of doing something similar on our system and am leaning towards deleting the existing pdf as our history will be in the part/assembly anyway.

             

            Kind regards,

             

            Stavros

              • Re: PDF Task Generation - PDF State
                Shawn Casebolt

                Stavros,

                Thanks for the suggestions!  That sounds like a great idea (deleteing the pdf).  Can you give me some advice on how to make that happen?  I dont necessarilly need step by step but overall guidelines...is it an action? etc..  If its a dispatch script, Im sunk, I dont know how to do those lol

                  • Re: PDF Task Generation - PDF State
                    Stavros Pantelakis

                    Are all of your pdf files all stored in a single location? If not can you give me an idea of the structure?

                     

                    I. E. Sw file - root directory\job no\cad

                    Pdf - root directory\job no\pdf

                      • Re: PDF Task Generation - PDF State
                        Shawn Casebolt

                        We have both, the job specific one would change on each project as it would be a new project name / number

                         

                        root\job specific\solidworks

                        and

                        root\internal library

                          • Re: PDF Task Generation - PDF State
                            Stavros Pantelakis

                            Something like this should work, or at least give you an idea of how to go about doing it.

                             

                            I've assumed the following:

                            Only the extension changes between PDF and SW file i.e. 1234.slddrw becomes 1234.pdf

                            All pdf files exist in a folder named 'PDF'

                            Revision scheme is numerical 1 digit (if not change the second jump to what ever your first value would be)

                             

                            Job related PDFs

                            PDF files stored one folder up

                             

                            Library PDF

                            One static location for all such PDFs

                             

                            Open the admin tool, expand 'add-ins' RC on Dispatch and select 'administrate actions' and load the attached acn file.

                             

                            After it is loaded in, double click on the dispatch function to edit the dispatch function and select the 'Variables button' to edit some of the variables.  Change the value of 'r_LibPDFFolder' to the path of the Library PDF folder.  You will also want to change 'r_NoCharToOneFldrUp' to the number of characters to get to the job root folder from the SW folder.  If necessary change '..\PDF\' in the variable 'r_JobPDFFolder' name of the PDF folder.

                             

                            I've set it to skip the delete section until you are happy that all of the tests are coming up with the correct directory.  If you delete the 'OkMessageBox' and the first 'Jump' it will then start to delete the pdf file, I would suggest testing that as a manual command before having it run on a state transition.

                             

                            The last thing you will need to do in the dispatch is to set the activation to 'During state transition' set the path to %solidworks\% and select the 'In Design' state for the drawing file.

                              • Re: PDF Task Generation - PDF State
                                Stavros Pantelakis

                                If your drawings are stored within various subfolders within the Solidworks folder, you can delete

                                r_JobRootFolder

                                r_NoCharToOneFldrUp

                                r_SWFilePathRev

                                r_JobRootFolderRev

                                r_SWPathLength

                                 

                                You will then need to create x number of variables set them to 'Variable Value from selected file(s) datacard' in order to get the same type of output path(s) that you've used for your convert to PDF task.  Once you have all of the variables you need set r_JobPDFFolder to  '%RootFolderPath%\%'variable1'%\%...%\%'variablen'%\PDF\'.

                      • Re: PDF Task Generation - PDF State
                        Stavros Pantelakis

                        Hello Shawn,

                         

                        I was playing about with something another user had posted here.  I have managed to use the document status to allow the pdf to follow the slddrw through the workflow.  It will require reprinting of the .pdf or using dispatch to update the pdf variable you use for the conditions for auto transition.

                         

                        Kind regards,

                         

                        Stavros