13 Replies Latest reply on Mar 26, 2009 6:44 PM by Devon Sowell

    Generate serial number

    Amit Chen
      Hi all,

      I'm looking for a way to generate the next serial number during Workflow transition?
      Any suggestions? Why it is so simple to do it with revisions?

      Thanks Amit
        • Generate serial number
          Jeremy Schmidt
          Let me know if you figure that one out. I couldn't come up with a solution that didn't involve custom code.
          • Generate serial number
            Amit Chen
            Do you have any custom code that you can share?
            • Generate serial number
              Ben Kalinowski
              Have you looked into the Serial Number feature in the admin tool?
              • Generate serial number
                Amit Chen
                Ben,

                I've already set serial number (using the admin tool) and attached it to a variable in the document card.

                The problem is that I would like to generate this serial number during workflow transition in the same way we all do with revisions.

                I must missed something because it's need to be simple to configure in any PDM tool.

                The onlly way I succeed to generate next serial is using templates but it has nothing to do with workflow.



                • Generate serial number
                  Amit Chen
                  No, it's not the file Name.

                  1. In every solidworks drawing card I've ECO-Number varible which was defined to be serial number.
                  2. In this way first time that creating the file I've the first number.
                  I would like that when the ECO process is apporoved together with updating the new revision the ECO number will be updated to the next one that is avilable.

                  I don't think that i can solve it without any custom code.
                  • Generate serial number
                    Dennis Hvam
                    Have you tried to create a preState or workflow where the files go through to get the number and then on to the actual workflow?

                    We have a startflow and everything is controled from there to other workflow, if a file is created in this folder it automatically gets the next serial number from the system. So a start workflow would be like:
                    If the file has been created in this path the file is auto transfered to the "serialNumber workflow" and auto transfered with a serial number to any workflow of your choice?

                    Thats what we do...
                    • Generate serial number
                      The code to connect to a vault and generate a serial number is pretty simple with VB.net

                      Dim VaultName As String = '*****Name of the Vault******
                      Dim vault As New EdmVault5
                      vault.LoginAuto(VaultName, Me.Handle.ToInt32)

                      Dim SerNo As IEdmSerNoGen6 = vault
                      Dim SerNum As String = SerNo.GenerateSerNo('********Name of the serial number*******)

                      Just add the name of the vault and the name of the serial number and you are good to go
                      The serial number is returned as the string "SerNum"
                        • Generate serial number
                          Jeremy Schmidt
                          I do not have any custom code as of yet. What if your serial number is your file name? In our case, we assign a temporary serial number upon file creation that is the file name. Then at some point in the workflow, the serial number and filename would change to a production number. I'm assuming there as issues with SolidWorks file references and such. Any ideas?
                        • Generate serial number
                          i wrote some code to rename a file with a serial number when it is added to the vault. The code isn't too terribly complicated but probably too much to post on a forum. It stores the original filename on the datacard for reference. Renaming the files is okay as long as they are checked into the vault. So it can be done and its not that hard but does require some custom programming.