5 Replies Latest reply on Sep 19, 2018 1:07 PM by Ulf Stockburger

    EPDM Transition with User Input

    Jason Lisy

      Is there a way to have a transition that prompts for a user input to set a variable? Often, files in our vault get transitioned when they shouldn't be, so the vault revision doesn't match the drawing revision. Currently, our workflow is set up so that we can manually transition a file to specific revision. But each revision is set up as it's own transition, so our workflow looks very cluttered. I would like to be able to have a transition that will ask me for the revision, and set it to that, so I would only have to have one instead of over 20. Is this possible?

        • Re: EPDM Transition with User Input
          Jeremy Feist

          I believe you could set that up with dispatch. (we don't have it turned on here, so I can't test).

          2018 SOLIDWORKS PDM Help - Dispatch (For SOLIDWORKS PDM Professional only)


          there is also a recently added command to "set revision" that may help you out as well.

          2018 SOLIDWORKS PDM Help - Set Revision Dialog Box

            • Re: EPDM Transition with User Input
              Paul Wyndham

              There is no option to manually set variables on transitions.

              You should be able to set up your transition to pull the revision variable from the file property. Then you should then be able to use the inc revision command to set the local revision to match the revision variable.


              The set revision function has to be done on a state where the revision is configured. It sets the local revision to whatever you select.



              Then select a file in that state and click Modify --> Set Revision


              You can then select the revision from the dropdown list. Make sure you select the "Update Variable" option if you want the Revision variable to match the Local Revision counter.



              You should end up with matching revisions.



              If you try to set the revision on a file in a state that does not have the revision setup it won't give you any options.

              In this example it doesn't let me do anything for the drawing while the assembly lets me select the revision it is currently set to.



              That file is in a state with the revision setup like this, it has the revision and revision variable selected but no increment to reset values.



              You can't run set revision during a transition.

                • Re: EPDM Transition with User Input
                  Jason Lisy

                  Thanks. I am somewhat new to EPDM administration, so I am still trying to learn. I did not know about the Set Revision command. I think that will work for some of my files, but not all of them. I was hoping to be able to clean up our workflow, but it sounds like I may not be able to until I learn a little more about how everything works.

                • Re: EPDM Transition with User Input
                  Jason Lisy

                  Thanks. We do have Dispatch installed, but I don't know how to use it. The Set Revision command may be what I need to do. I did not know of that before reading the replies to my message.

                • Re: EPDM Transition with User Input
                  Ulf Stockburger

                  Hi Jason

                  Is there a way to have a transition that prompts for a user input to set a variable?

                  As far as I know, it's not possible by default. In order to get a 100% solution, I suggest an add-in adapted to your needs.

                  If a 90% solution is enough, you can go this way. This example uses VBScript, but it also works in other languages.

                  -Create a new Transition Action in which the variable has to be set.

                  -Replace <your extension> with the file extension for which this transition is valid.

                  -Replace <full script name> with the name of the following script to be executed in this transition.


                  Customise the script between <VBScript> and </VBScript> to your needs and save it as *.vbs.

                  Replace <your vault> with your vault.

                  Replace <your variable> with your variable.


                  Set objRegEx = CreateObject("VBScript.RegExp")
                  objRegEx.Global = True   
                  objRegEx.IgnoreCase = True
                  objRegEx.Pattern = WScript.Arguments(0)
                  fileName = WScript.Arguments(0)
                  folderName = objRegEx.Replace(WScript.Arguments(1), "")
                    revNo = InputBox ("Please enter the Revision No.:")
                    If revNo = "" Then
                      Wscript.Echo "You have to enter a Revision No."
                      Exit Do
                    End If
                  set vault = createobject("conisiolib.edmvault")
                  vault.loginauto "<your vault>", 0
                  set folder = vault.GetFolderFromPath(folderName) 
                  set filePos = folder.GetFirstFilePosition()
                  do while filePos.isnull = false
                    set file = folder.GetNextFile(filePos)
                    if (file.Name = fileName) then
                      exit do
                    end if
                  file.LockFile folder.ID, 0 
                  set fileVar = file.GetEnumeratorVariable("")
                  fileVar.SetVar "<your variable>", "", revNo
                  file.UnlockFile 0, "Checked in by VBScript"



                  This example only shows what is at least necessary to solve the problem. Most of the work, the error handling, is missing.


                  BiI SAP-PDM