7 Replies Latest reply on Mar 18, 2016 3:59 PM by Cad Admin

    Revision Table Macro

    Daniel Martínez



      I am trying to create a macro that will allow the user to input text and the text will be populated on the APP box for the latest revision table row. How can I call for the latest row and that specific column? I have got the part where I can get the input box to pop up and everything else, all I am actually needing is a way to call for that specific box. I am aware of the Revision Table macro going around the forum that allows the user to input all the information for the whole table row, I even tried pulling the code from there but can't seem to understand how they are calling for the boxes or even putting the user-input text in the fields.



        • Re: Revision Table Macro
          Matt Martens

          Have at the look at the macro I wrote that does this. I use a numbered revision scheme and the macro also keeps the revision table at 3 rows by deleting the oldest row if the table will go over 3.

            • Re: Revision Table Macro
              Daniel Martínez



              Thanks for sharing your macro. This is kind of what I had running although it was not working, but looking at your macro made me realize that I was missing a variable and that's why it was not populating into the field.  What I am trying to do now is have the code check to see if there's any text on that field already, but cant seem to make it work.

              • Re: Revision Table Macro
                Cad Admin


                I'm looking to do something similar, I'm running your macro on my rev table and the description is altering the wrong field.  I can alter the code get it to fill in the right field the first row, however the NEXT revision overwrites the same field as the first. I guessing it is related to the incremental code.


                this is what my table looks like.

                Also will the macro handle a 00 revision, i see it address a less than 10 and apends the variable...how would it address a 00 rev level?

                  • Re: Revision Table Macro
                    Matt Martens

                    I designed this macro for when I wish to bump my parts to the next revision. It adds a line to the revision table, or in the case of it being the first revision adds the table itself, bumps the revision of the drawing, model, and assembly if they all have the same drawing number, and add the description that was input into the revision table. It doesn't handle the 00 revision because I don't put the 00 revision in the table and I use the macro to bump the revision as part of the process.


                    The reason the code is overwriting the description on subsequent runs is my revision table are on the bottom of my sheets and when the revision gets added it is always top row of the table. The new revision is always in the same place. So i wrote the macro accordingly.


                    Screen Shot 03-18-16 at 01.00 PM.BMP

                    The "0" is this line

                    swRevTable.Text(0, 2) = revDesc

                    needs to be altered so that you are always addressing the last row of the table. You should ITableAnnotation::RowCount to get the right row to change the text of.


                    Something like:

                    swRevTable.Text(swRevTable.RowCount - 1, 2) = revDesc


                    integer = swRevTable.RowCount - 1

                    swRevTable.Text(integer, 2) = revDesc

                    should work.


                    The code that addresses the less than 10 was added because get the current revision from the revision table, which uses single digits, but i want my revision custom property to always be double digits (table shows revisions 1, 2, 3 but the revision property should be 01, 02, 03). Because i am not familiar with your procedure for revising and where your users are inputting the 00, 0 that you addressed here: Macro Conditional variables, i'm not sure how to correct the code for your use. A little more explanation may help me.