Brian
Here is some code i use for managing drawing tables.
In general this code loops and searches all tables in the active drawing that came from a format.
The code looks for a table where the content of the first cell="Qty." (this is to make sure i got the correct table)
It also deletes all tables that does not confirm to the above.
Hope it helps :-)
By the way, VBA in Creo is a great tool so dont give up....
Dim table AsIpfcTable = Nothing
Dim tables As IpfcTables
tables = active_drawing.ListTables()
For i = 0 To tables.Count - 1 table = tables.Item(i)
If table.CheckIfIsFromFormat(sheetno) = True Then
' Manage BOM table
If KeepBOM = True Then
' Check if table is a BOM table
Dim MyCell As IpfcTableCell
MyCell = (
NewCCpfcTableCell ).Create(1, 1)
Dim mode mode = (
NewCCpfcParamMode ).DWGTABLE_NORMAL
Try
Dim textseq = table.GetText(MyCell, mode)
' If table is not a BOM table, delete it
If textseq.Item(0).ToString <> "Qty." Then
active_drawing.DeleteTable(table,
False )
End If
Catch
' Cell has no value, delete table
active_drawing.DeleteTable(table,
False )
End Try
Else
active_drawing.DeleteTable(table,
False )
End If
End If
Next