25 Replies Latest reply: Dec 11, 2013 11:51 AM by Kip Speck

    Macro to change revision scheme of revision tables

    Charles Lee

      I've been hunting around, but can't quite find an existing macro that will do this for me.  I want to create a macro that will change all the drawing files in a folder so that the revision table is updated.  We're changing to a tiered revision scheme where prototype/developmental parts are at one revision scheme.  Then once it enters production, there's another revision scheme.  i.e. development is -.01, -.02, -.03, etc and production is rev A, B, C.  The reason being development doesn't require the same approval loops that we have in place for production.  Anyway, I'm checking my files into EPDM and I've setup a workflow to convert existing documents to the development revision scheme.  The problem is the revision tables on all the drawings aren't updating to the development revisions scheme even though the revision variable has been updated to -.01 for example.  What I have now is a bunch of drawings that say -.01 in the title block, but the revision block still says rev A.

       

      Any ideas on how to change this?  Writing a macro seems to be better than Dispatch/EPDM, but either way, I'm a total newbie so I'm learning as I go. 

        • Re: Macro to change revision scheme of revision tables
          Kip Speck

          Charles,

           

          Did you create a new Variable in EPDM for the Revision or did you continue toi use "Revision"?

           

           

          --Kip

            • Re: Macro to change revision scheme of revision tables
              Charles Lee

              I used the same revision variable.  I created a new workflow that reads in Legacy drawings.  Then had the user select which state it should go to: Development or Production... where each is using a different revision scheme.  It reads the revision of the drawing (i.e. B) and bumps it to C in the Production branch (since we're going from a "-", A, B revision scheme to A, B, C scheme), or it changes it to -.02 in the development branch.

            • Re: Macro to change revision scheme of revision tables
              Keith Rice

              Charles,

               

              I am not certain exactly what you're trying to change, perhaps because I don't have a lot of experience with revision tables, but if you're trying to change an aspect of the revision table itself then you should take a look at the IRevisionTableAnnotation and IRevisionTableFeature interfaces. If you're looking to learn the API, check out our tutorials.

               

              Keith

              SolidWorks API Video Tutorials

                • Re: Macro to change revision scheme of revision tables
                  Charles Lee

                  thanks... I'll have to check those out when I'm at home... Unfortunately, that site is blocked here at work. 

                  As far as the revision tables are concerned, we're using the default revision tables that come with Solidworks.... basically the first column is the revision, followed by a description, date, and a field for approver's initials.  The first column is supposedly tied to the revision variable, much like the revision variable that is in the title block that's in the lower left hand corner of most drawings.  The other fields/columns appear to be free text fields.  Anyway, when I update the revision variable through Dispatch/EPDM, the title block is updated, but not the revision table.  The title block says rev "-.01", but the revision table still says rev A.

                  I'm not really sure how the revision table works either.  Perhaps, when adding a row to the table solidworks reads the revision and then inserts the text but it's not still continuously linked to the revision variable.  However, if you change the revision field on the revision table, the revision symbols (triangles) are updated as well... not really sure what to make of that. 

                   

                  Anyway, I guess I don't really care what's going on underneath it all.  I just want to update the tables without having to open up each drawing individually.  Hope that explains it... kinda went on a tangent there...

                   

                  --Charles

                    • Re: Macro to change revision scheme of revision tables
                      Kip Speck

                      Charles,

                       

                      I am fairly certain that EPDM will NOT update the solidworks revision table.

                       

                      why would you use the Revision Table in the drawing to control what revision the it is at when you are using EPDM to manage your revisions.

                       

                      the solidworks revision table would be used if you were not managing your files in a PDM/PLM system, rather if you were using a network share.

                       

                      Most companies have custom properties where the revision table would be.  Granted there is a slight limitation to showing multiple revision history there.  But this can be overcome, and again because you use EPDM it may not be necessary to show multiple revision history on the drawing.

                       

                      --kip

                        • Re: Macro to change revision scheme of revision tables
                          Charles Lee

                          Well, we're still in the process of implementing EPDM.  For the most part, we have a ton of legacy drawings that need to be imported into EPDM and I have a group of drawings that I need to change the revision scheme of.  We're still at the point where we're using printouts or pdf's to show what the revision of the drawing is at, so having the revision history on the drawing itself is still necessary.  The problem I'm having is importing an existing file, that's at revision B for example, into EPDM.  It's at that revision because the file has been sent out to vendors and such, and of course we're keeping a record of who has what.  Anyway, there aren't any approvals at this point because the program is still in development.  So I want to take a group of existing drawings and transpose the revision scheme to -.01, -.02, etc.  I created a workflow to convert the revision scheme of these drawings to the new revision scheme.  The revision in the title block changes, but not the revision table.

                          I've tried using EPDM/Dispatch to update the revision table, but I'm hitting a wall.  I've also tried finding a macro that would change all the files in a folder, but the closest I could find is a macro that adds or deletes rows from a revision table.  I'm not savvy enough with the macros to edit it, but my intent would be to change the macro so it edits the revision table and replaces rev "A" with rev "-.01"

                           

                          Any help?

                            • Re: Macro to change revision scheme of revision tables
                              Kip Speck

                              Charles,

                               

                              I see what you want to do, without doing a proper migration and dealing with these issues as the files are brought into EPDM, you will be fighting the battle for a while.

                               

                              typically you migrate files at the revision they currently are at, to maintain history.  You put them into a state in a workflow that matches the state of the files, such as development or r and d.  for the files that you are in these states, create a specific workflow, and either mandate the users update the title block formats to the newer one before it goes to the production workflow, or you will have to write code to do it.

                               

                              no matter how you decide to deal with this, you have multiple additional problems, formats, current revision, signatures, etc..  You should not change data or files while migrating into EPDM. Migrate them, then as a additional step, make your updates so that  you have history of what was done and why there is a difference between the original files and the migrated files.

                               

                              I have done numerous migrations in my career and have specific tools / programs to do this.  If you want you can shoot me an email with your number and I would be happy to.discuss this.  A forum will not do justice.

                               

                              kip.speck@stratus-x.com

                                • Re: Macro to change revision scheme of revision tables
                                  Charles Lee

                                  k... I have a state in my legacy import workflow before any edits are made.  It's probably the perfect point to run a macro to update the files.  I just need to add a loop so the version is bumped and of course, the macro itself. 

                                   

                                  Anyone know how to edit a field in a revision table using a macro?

                                    • Re: Macro to change revision scheme of revision tables
                                      Kip Speck

                                      Charles,

                                       

                                      you should really consider removing the "revision table" from the drawing.

                                       

                                      to do this you may  also need to update the format.

                                       

                                      if you want the the information in the revision table to be on the drawing, .and you want epdm to manage, then you should use epdm to create and manage a pseudo revision table that resembles that of your current one.

                                       

                                      I may suggest that you cull the revision date from the drawings and store it in the data card for legacy purposes. Then going forward maybe keep the latest 3 or 4 revisions on the drawing.

                                       

                                      this can be done,

                                        • Re: Macro to change revision scheme of revision tables
                                          Charles Lee

                                          that's a really good idea, but probably not necessary for us.  Generally we have a low revision count on most of our drawings.... mostly 1 or 2 revisions... on the rare occasion we could have as much as 7.  We generally create new numbers since the old p/n is still being used elsewhere. 

                                          • Re: Macro to change revision scheme of revision tables
                                            Jeff Thomas

                                            Kip, I like your line of reasoning. Our Design Control and ECO process's are both defined and controlled within EPDM. Once a design is released (Revision Controlled) the files can't be changed unless an ECO is written. It would be fairly easy to add the ECO # to the CAD cards as the files pass the "Revision Change" transition. This could also be added to the drawing in a pseudo REV table as you recomended above.  However I have a couple of questions for you.

                                             

                                            Question 1

                                            One of the benifit's of using the REV table is it allows for the placement of REV Balloons on the drawing when a new REV is added to the table. How do you handle the REV balloon placement?

                                             

                                            Question 2

                                            Do you add REV notes to your drawings or rely on the user to look up the ECO to see what changed?

                                             

                                            Thanks for your feedback. We are about to go live with EPDM after the first of the year and there a few things I still need to tidy up. Once we go live I am sure the list will grow significantly.

                                             

                                            Jeff

                                              • Re: Macro to change revision scheme of revision tables
                                                Kip Speck

                                                Jeff,

                                                 

                                                Answer 1: Yes the user has to place the Revision Balloons on the drawing.

                                                Answer 2: Either or both can be used.  We have in automated adding the lat 3 rev notes on the drawing, as well as on the Data card in EPDM.  This way when you search EPDM, you can search all versions, or look at the EC.  If it is strictly SolidWorks then you are limited to searching the EC.

                                                 

                                                 

                                                 

                                                Jeff you are asking good qurestions, and looks like you are on your way.  If you have not looked into the SolidWorks CEPA (Certified Enterprise PDM Administrator exam, I would suggest you do so).

                                                 

                                                 

                                                 

                                                Kip

                                • Re: Macro to change revision scheme of revision tables
                                  Charles Lee

                                  This discussion has gotten a little off topic so I'll try and bring it back on course. 

                                  I'm hoping to edit/combine a few different macros so that I may read in the revision table and edit the table so that rev A is replaced with "-.01" and B is replaced with "-.02" and so forth.  I'd like to do this for an entire folder of drawings. 

                                   

                                  There is an existing macro called RevBlockAdd.swp that I've found that's supposed to add a row to the revision block (although I haven't gotten it to work for some reason--**edit... it's because its 32bit and I'm working on 64bit... I've corrected it, but it's not attached here.).  I'm looking to make it run on a folder full of files... similar to PropertyEditorGlobal.swp.  I need to combine the two macros then add something so that I may edit the first column of the revision table to my own revision scheme.

                                   

                                  I'm hoping someone can walk me through how to change this.  and also how to add in the command strings.