5 Replies Latest reply on Nov 13, 2013 4:40 AM by Tim Read

    Dispatch sorting works every other time

    Karen Brunke

      I wrote a dispatch routing to check the filenames before transitioning the files to ISSUED.  The requirement is that the filename start with the project number.  If they succeed, it seems to work every time, but if it fails, it only works every other time.  I can't figure out why? I am on SWX2012 SP5, and EPDM 2013.

       

      Here is a ridiculously small picture of my script, but there is also a copy of the picture in Attached files.  I also put a copy of the dispatch routine in attached files.

      DispatchCheckNameRoutine.PNG

        • Re: Dispatch sorting works every other time
          Tim Read

          Hi Karen,

           

          I've had this exact issue...

           

          https://forum.solidworks.com/message/268716#268716

           

          I created a workaround... Run the "check" twice in the Dispatch script.

           

          The first line of the Dispatch script sets a registry key to "0". I then Jump over the next section (that sets the registry key to "1"). The following part of the script does the checks and at the end of the checks I test the registry key - if it is "0" I Jump back to the second section that sets the registry key to "1" and then runs the checks...

           

          We shouldn't have to do this but I got almost zero action from my "VAR" / SolidWorks.

           

          Tim

            • Re: Dispatch sorting works every other time
              Karen Brunke

              I'm sorry.  I'm sure it should be obvious.  I went and read the post you linked, but I don't know which script I am supposed to be looking at.  I don't recognize anything as a registry key being set to 1 or zero.  I've not used the registry key option. Is there a specific registry setting I need to change or are you just explaining what happens in the background?  Will you provide me an example?

                • Re: Dispatch sorting works every other time
                  Tim Read

                  Hi Karen,

                   

                  I can see your confusion - my reply should have been in two parts... I had / have the same issue (see thread) and I created a workaround that I outlined in my reply.

                   

                  I have attached the dispatch script I used to test this issue and to build my workaround. The script is a mess but captures the issue...

                   

                   

                  When running the script:

                  If you select only parts and drawings then the script will loop twice every time you run it with one exception - see next line.

                  If you select an Assembly the script executes the Cancel and then the next time you run it the script it jumps over the first loop... even if the second time you run the script you only select parts / drawings...

                   

                  I hope this makes the issue a little clearer. The Cancel command screws up the Block the NEXT time the script is run. By looping twice the 'condition' is reset within the script so that the loop will always run at least once :-)

                   

                  Tim

              • Re: Dispatch sorting works every other time
                Tim Read

                Here's the SPR Number: 695000

                  • Re: Dispatch sorting works every other time
                    Joy Garon

                    Hi All,  Tim beat me to it.  The description for the SPR is: Using a JUMP to step out of Dispatch script 'For all documents' - 'End for all documents' loop causes the script to skip the loop next time it runs.  "IF" this is the problem you experience, it is important to report it to your VAR and reference the SPR #. Equally important is to provide your VAR the dispatch action file (.acn) so that they may attach it to the SPR. QA uses these to validate any fix.  Cheers, Joy