Try this, set it upt to be fires on drawing save event.
If ThisApplication.ActiveEditDocument.subtype="{BBF9FDF1-52DC-11D0-8C04-0800090BE8EC}" Then
Dim oDrawDoc As Inventor.DrawingDocument = ThisApplication.ActiveEditDocument
Dim oRevTable As RevisionTable
'get the current rev letter
oRev = iProperties.Value("Project", "Revision Number")
Try 'try to get the first rev table on the active sheet
responce = MessageBox.Show("Do you want to delete revision data?", "revision", MessageBoxButtons.YesNo)
If responce.ToString="Yes" Then
oRevTable = oDrawDoc.ActiveSheet.RevisionTables.Item(1)
'define the rev table rows collection
Dim oRows As RevisionTableRows
oRows = oRevTable.RevisionTableRows
Dim orow As RevisionTableRow
oRows.Add
'look at all of the rows in the rev table
For Each oRow In oRows
If orow.IsActiveRow Then
'do nothing for the active row
Else
orow.Delete 'deletes rev tags also
End If
Next
oRevTable.Delete
'set rev number/letter back to what it was
'iProperties.Value("Project", "Revision Number") = oRev
Dim odoc As Document
odoc = oDrawDoc.ReferencedDocuments.Item(1)
odoc.PropertySets.Item(1).Item("Revision Number").Value=""
oDrawDoc.PropertySets.Item(1).Item("Revision Number").Value = ""
End If
Catch 'catch error when no rev table is found
MessageBox.Show("Error: Most likely no revison table was found", "iLogic")
Dim odoc As Document
odoc = oDrawDoc.ReferencedDocuments.Item(1)
odoc.PropertySets.Item(1).Item("Revision Number").Value=""
oDrawDoc.PropertySets.Item(1).Item("Revision Number").Value=""
End Try
End If
If ThisApplication.ActiveEditDocument.subtype="{BBF9FDF1-52DC-11D0-8C04-0800090BE8EC}" Then
Dim oDrawDoc As Inventor.DrawingDocument = ThisApplication.ActiveEditDocument
Dim oRevTable As RevisionTable
'get the current rev letter
oRev = iProperties.Value("Project", "Revision Number")
Try 'try to get the first rev table on the active sheet
responce = MessageBox.Show("Do you want to delete revision data?", "revision", MessageBoxButtons.YesNo)
If responce.ToString="Yes" Then
oRevTable = oDrawDoc.ActiveSheet.RevisionTables.Item(1)
'define the rev table rows collection
Dim oRows As RevisionTableRows
oRows = oRevTable.RevisionTableRows
Dim orow As RevisionTableRow
oRows.Add
'look at all of the rows in the rev table
For Each oRow In oRows
If orow.IsActiveRow Then
'do nothing for the active row
Else
orow.Delete 'deletes rev tags also
End If
Next
oRevTable.Delete
'set rev number/letter back to what it was
'iProperties.Value("Project", "Revision Number") = oRev
Dim odoc As Document
odoc = oDrawDoc.ReferencedDocuments.Item(1)
odoc.PropertySets.Item(1).Item("Revision Number").Value=""
oDrawDoc.PropertySets.Item(1).Item("Revision Number").Value = ""
End If
Catch 'catch error when no rev table is found
MessageBox.Show("Error: Most likely no revison table was found", "iLogic")
Dim odoc As Document
odoc = oDrawDoc.ReferencedDocuments.Item(1)
odoc.PropertySets.Item(1).Item("Revision Number").Value=""
oDrawDoc.PropertySets.Item(1).Item("Revision Number").Value=""
End Try
End If