Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

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

3 REPLIES 3
Reply
Message 1 of 4
gavinc
681 Views, 3 Replies

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

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?

 

 

3 REPLIES 3
Message 2 of 4
xiaodong_liang
in reply to: gavinc

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

 

 

 

 

 

 

 

Message 3 of 4
gavinc
in reply to: xiaodong_liang

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

Message 4 of 4
xiaodong_liang
in reply to: gavinc

sorry, a typo:

 

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

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report