You would need to step through the ipart table like this rule which checks whether Inventor can compute each row in the iPart/iAssembly table - FWIW I'm not sure I ever properly test the iAssembly section of this rule! Buyer-beware:
Sub Main()
CheckiPartTableForErrors()
End Sub
Sub CheckiPartTableForErrors()
Dim oErrorManager As ErrorManager = ThisApplication.ErrorManager
If TypeOf (ThisApplication.activedocument) Is partdocument Then
Dim oDoc As PartDocument = ThisApplication.ActiveDocument
Dim oiPart As iPartFactory = oDoc.ComponentDefinition.iPartFactory
Dim oTop As BrowserNode = oDoc.BrowserPanes("Model").TopNode
Dim bHasErrorOrWarning As Boolean
Dim i As Integer
InventorVb.DocumentUpdate()
ThisApplication.SilentOperation = True
For i = 1 To oiPart.TableRows.Count 'use first 10 rows only for debugging purposes!
' Highlight the 3rd iPart table row which has invalid data
oTop.BrowserNodes("Table").BrowserNodes.Item(i).DoSelect
' Activate the iPart table row
Dim oCommand As ControlDefinition = ThisApplication.CommandManager.ControlDefinitions("PartComputeiPartRowCtxCmd")
oCommand.Execute
ThisApplication.SilentOperation = False
ThisApplication.CommandManager.ControlDefinitions.Item("AppZoomallCmd").Execute
If oErrorManager.HasErrors Or oErrorManager.HasWarnings Then
MessageBox.Show(oErrorManager.LastMessage, "Title")
End If
Next i
MessageBox.Show("No errors shown = None found!", "Title")
ElseIf TypeOf (ThisApplication.activedocument) Is assemblydocument Then
Dim odoc As assemblydocument = ThisApplication.activedocument
Dim iAssy As iAssemblyFactory = odoc.componentdefinition.iassemblyfactory
Dim oTop As BrowserNode = odoc.BrowserPanes("Model").TopNode
Dim bHasErrorOrWarning As Boolean
Dim i As Integer
InventorVb.DocumentUpdate()
ThisApplication.SilentOperation = True
For rowIndex = 1 To iAssy.tablerows.count
oTop.BrowserNodes("Table").BrowserNodes.Item(i).DoSelect
Dim oCommand As ControlDefinition = ThisApplication.CommandManager.ControlDefinitions("PartComputeiPartRowCtxCmd")
oCommand.Execute
ThisApplication.SilentOperation = False
ThisApplication.CommandManager.ControlDefinitions.Item("AppZoomallCmd").Execute
If oErrorManager.HasErrors Or oErrorManager.HasWarnings Then
MessageBox.Show(oErrorManager.LastMessage, "Title")
End If
Next
End If
End SubAnd working with the above you could (in theory) populate a new drawing template with a view that contains the currently active table row configuration.