13 Replies Latest reply on Dec 5, 2013 8:33 AM by Lawrence Kiefer

    EPDM Dispatch...help!

    Lawrence Kiefer

      Attached is a simple dispatch I am working on. What I am trying to do is as follows.

       

      1. Run Dispatch
      2. If the data card variable "description" is empty open edit box window to fill in description. BUT if this fiels is not empty then jump to the end.

       

      I bassically want a check for data card properties. Eventually I will set this up for all fields in my data card. I am simply trying to get it to work on one variable first.

      The user should be propted to input a value for any empty fields, and not continue until they enter somthing.....once they enter somthing into this fiels, it should procede to the next variable field. Once all data card fields have values, the dispach should end.

       

      If anyone can help with this i would really appretiate it.

        • Re: EPDM Dispatch...help!
          Charley Saint

          Lawrence,

           

          In variables you need to set the configuration of V_Description to something ("@") unless it's running on non-CAD files. The second and third jumps do nothing because regardless if they are true or not they fall through to the next line. Try this:

          Dispatch.png

          • Re: EPDM Dispatch...help!
            Lawrence Kiefer

            Craig,

             

            Thanks for the help. I cannot get this to work. I input all of the code as you show it, and when I run it, the Edit box pops up, but it does not check out the file and input the property. I have attached it to this post if you could take a look and see where I am going wrong I would be greatful.

              • Re: EPDM Dispatch...help!
                Craig Lalumiere

                Laurence,

                 

                I have seen a few things

                 

                1. Your first jump statement is saying if the file is not a part then skip the program. So it is only looking at parts it that your intention?
                2. In your set card variables check the variable you are writing to. It came up to me that it was writing it to the comments variable not my description variable. If there named differently than I have it this could be the reason but should be looked at.
                3. Also in the set card variables you have the set string variable set incorrectly it needs to be the string variable of V_NewDescription not V_Description you want to write  the new variable to the card location not the old blank one. I feel this may be your root cause.

                 

                Craig

                CEPA

                  • Re: EPDM Dispatch...help!
                    Lawrence Kiefer

                    Craig,

                     

                    You were right on the money. I made the changes as you described above, and it now works. The only thing that I would like to be able to do now, is if the description field is already populated, I would like it to just skip to the end. As it is right now, when the check is run, even if the description field is populated, it still ask the user to fill this in. THe reason I want this to ignore fields that are already populated is I am going to set a trigger to run this dispatch at a certain state for multiple card field and I only want it to propt the user if a field is empty.

                     

                    Im game with sending you a case of beer for your help so far

                     

                    Thanks a bunch.

                • Re: EPDM Dispatch...help!
                  Lawrence Kiefer

                  I see that you have a jump, shown below on the third string, that tells it, if there is a description, then go to HasDescription. Any Idea why this is not working. Even with the description it still propts for it.

                   

                    • Re: EPDM Dispatch...help!
                      Craig Lalumiere

                      Check a couple things

                       

                      • Make sure on your set variables tab V_Description is set to the @ configuration and to the correct data card variable.
                      • Double check to see in the jump statement that the != is to nothing (no spaces in that area)
                        • Re: EPDM Dispatch...help!
                          Lawrence Kiefer

                          Craig,

                           

                          I cannot thank you enough. You just helped me complete somthing I have been strugling with for 3 days, literally.

                           

                          I have no issues putting in time to learn these things but unfortunately I have not been able to find anything on the web that really teaches dispatch inside and out. It seems to me that the only way to learn this is through trial and error, and through people like you willing to share knowledge.

                           

                          Thank you...

                            • Re: EPDM Dispatch...help!
                              Craig Lalumiere

                              One of the best help guides is done by Joy Garron. She does a presentation SolidWorks world that will give you a better understanding. If you are going this year its worth stopping by but you can also look at the online presentation I believe each year she has done one. You can download a help booklet too there.

                               

                              Dispach is one step above manually writing API's just has a nicer interface and if its updated you dont have to change your code.

                                • Re: EPDM Dispatch...help!
                                  Lawrence Kiefer

                                  Craig,

                                   

                                  I just noticed somthing. If I check in a new part lets say....with no description, and then I either manually run the dispatch OR I let the workflow state I defined trigger it, it works as it should and populated the description field on the card.

                                   

                                  After this, if I check the part out, delete the description (which can happen if we use an existing part to create a similar one) and then check it back in and run the dispatch again, it does not run.

                                   

                                  Further more, after this if I create a new part from scratch, and then run the dispatch it wont work this time around. Its almost like once my dispatch runs once, it gets hung up or somthin, although I am confident it is somthing I did. IF you wouldnt mind too much taking a look at it, I have attached it. To me, everything looks in order.