9 Replies Latest reply on Oct 1, 2014 8:34 AM by Daniel Seaman

    epdm daily check in

    Emily Augason



      I'm trying to implement a nightly sweep of all checked out files in our vault.  There are only two main users in the vault including myself, but we move around between multiple locations and computers and have been frustrated by files checked out on the wrong computer.


      I've been trying to figure out how to create some kind of time or date triggered epdm transition or dispatch action, but there doesn't seem to be any way.


      Is this possible without more complicated programming?  It seems like it should be fairly simple to do, but I'm pretty stuck.




        • Re: epdm daily check in
          Michael Dekoning

          Have you looked at EPDM Tasks? I think this would be the only way to run something on a scheduled basis.

          • Re: epdm daily check in
            Brian McEwen

            You could also consider a search favorite or a report. But you would need to get in the habit of running it.  It could just be files checked out by the current user.


            ...An automatic check-in seems a bit risky, if that is what you intend to do, but a reminder about check-in might be good.  On the other hand you can always go back to previous versions. 


            I assume Dekoning is taking about a New Task of the General variety. How do you make an EPDM task run at a specific time?  


            Under "Enter script to execute in SolidWorks" what language is that anyway?  ...I'm not helpful but I'm interested.

              • Re: epdm daily check in
                Michael Dekoning



                To do what Emily is wanting would require writing a Task add-in with the EPDM API. There is a flag that you set in the code to allow scheduling. When you set up the Task to run in the Adin tool, you can configure the day, time and interval that the Task should be run.


                The "Enter script to execute in SolidWorks" appears in the SolidWorks Task provided with EPDM for batch convert and print operations. You can customize it to perform other actions by entering a Visual Basic macro script.

                • Re: epdm daily check in
                  Daniel Seaman

                  Hi Brian,

                  Tasks can only be scheduled if the add-in they use indicates that it supports scheduling. If you look at the example here http://help.solidworks.com/2015/English/api/epdmapi/TaskSample.htm, the key bit of code is:

                  Dim props As IEdmTaskProperties
                    props = poCmd.mpoExtra

                    'Turn on some properties, e.g., the task can be launched during a
                    'state change,
                  can extend the details page, is called when the
                    'task is
                  launched, and supports scheduling
                    props.TaskFlags = EdmTaskFlag.EdmTask_SupportsChangeState + EdmTaskFlag.EdmTask_SupportsDetails + EdmTaskFlag.EdmTask_SupportsInitExec + EdmTaskFlag.EdmTask_SupportsScheduling


                  The script language used the SWTaskAddin is Visual Basic for Applications (VBA).


                  When the task executes the script is parsed for macro* tokens (e.g. <Filepath>) and these are replaced by values based on the current selection. The script is then sent to SOLIDWORKS as a macro to be executed.


                  When you're developing a script for a task its a good idea to start out with a SOLIDWORKS VBA macro and only adapt it to a task script once the macro is working as you want.




                  * Macro as in a string token in code to be replaced with another string before the code is compiled.

                  ** Macro as in code to be executed by a host program.

                    • Re: epdm daily check in
                      Brian McEwen

                      Thanks Daniel and Michael.  This will require some further study on my part.  I hope it helped Emily also. 


                      Do I understand and assume correctly that the SWTaskAddin may be used to create a custom script (for a scheduled task), but in many cases one would just write a standalone add-in to do the job?

                  • Re: epdm daily check in
                    Daniel Seaman

                    Hi Everyone,

                    The Add-In solution Michael Dekoning describes is pretty much one of the use cases taught on the API Fundamentals of SolidWorks Enterprise PDM course:



                    You can download the training files without attending the course but I wouldn't recommend it; debugging Tasks is not trivial.