Revision Table - delete table, add table, add text to active row

Revision Table - delete table, add table, add text to active row

gavinc
Participant Participant
1,125 Views
3 Replies
Message 1 of 4

Revision Table - delete table, add table, add text to active row

gavinc
Participant
Participant

I'm new to i-logic and VBA.

I have a lot of drawings that I need to delete inactive rows of a revision table and update all cells with the same information.

 

I was thinking it may be best to delete the table and then add it back into the drawing at a specific location relative to the sheet size of the drawing.

Is that the best way or would it be easier to delete inactive rows of the revision table, then add the required information into the cells.

I would like the cell information to remain in the form for the next drawing I open, so it can be repeated easily. Would this need to come from a spreadsheet? How can I achieve this?

 

Can anyone help please?

 

 

0 Likes
1,126 Views
3 Replies
Replies (3)
Message 2 of 4

xiaodong_liang
Autodesk Support
Autodesk Support

Hi,

 

The current API provides the property to check if the row is active and the method to delete it. e.g. the VBA code below iterates all revision table of the active sheet and deletes the inactive rows. 

 

hope this helps.

 

 

Sub deleteinActiveRow()

    Dim oDrawingDoc As DrawingDocument
    Set oDrawingDoc = ThisApplication.ActiveDocument
    
    Dim oActiveSheet As Sheet
    Set oActiveSheet = oDrawingDoc.ActiveSheet
    
    Dim oEachRevisionTable As RevisionTable
    Dim oEachRow As RevisionTableRow
    For Each oEachRevisionTable In oActiveSheet.RevisionTables
        For Each oEachRow In oEachRevisionTable.RevisionTableRows
            If oEachRow.IsActiveRow = False Then
                'if it is inactive row, delete it
                oEachRow.Delete
            Next
        Next
        
    Next
End Sub

 

 

 

 

 

 

 

0 Likes
Message 3 of 4

gavinc
Participant
Participant

Thank you. I am getting a compile error "Next without For"

0 Likes
Message 4 of 4

xiaodong_liang
Autodesk Support
Autodesk Support

sorry, a typo:

 

If oEachRow.IsActiveRow = False Then
       'if it is inactive row, delete it
       oEachRow.Delete
End If

0 Likes