Hi,
Break execution of iLogic rule, edit document manually and continue execution is little bit tricky. You can use some another approach.
1) You can run your iLogic and when the number of drawing views is not correct, write the file name to external file. Then you can open and edit this drawings manually.
2) You can store your iteration variable (for example "lastIndex") and file name collection to shared variables and iterate this collection with For loop. In For loop you can store last iteration variable value to shared variable lastIndex. When you found drawing with incorrect vies cout, keep open the drawing and break execution. When you finish manual edits, start execution again and start iteration from lastIndex
3) You can create external application and in this case is possible to have continue button and it can work as you write above. This is because Inventor and your application runs in separate processes.
Code sample for approach 2)
Sub Main
Dim drawingsPath As String = "C:\Path\To\Your\Drawings\Here"
Dim drawingsSharedVariableName = "drawingFileNames"
Dim lastIndexSharedVariableName = "lastIndex"
Dim drawingFileNames As String()
If SharedVariable.Exists(drawingsSharedVariableName)
drawingFileNames = SharedVariable(drawingsSharedVariableName)
Else
drawingFileNames = System.IO.Directory.GetFiles(drawingsPath, "*.idw", System.IO.SearchOption.AllDirectories)
SharedVariable(drawingsSharedVariableName) = drawingFileNames
End If
Dim fromIndex As Integer = 0
If SharedVariable.Exists(lastIndexSharedVariableName) Then
fromIndex = SharedVariable(lastIndexSharedVariableName)
End If
For i As Integer = fromIndex To drawingFileNames.Length - 1
Dim drawingFileName As String = drawingFileNames(i)
If UserEditNeeded(drawingFileName) Then
SharedVariable(lastIndexSharedVariableName) = i
Exit Sub
End If
Next
MsgBox("Done", MsgBoxStyle.Information)
SharedVariable.RemoveAll()
End Sub
Function UserEditNeeded(drawingFileName As String) As Boolean
Dim drawingDoc As DrawingDocument = ThisApplication.Documents.Open(drawingFileName)
'Implement your condition here
If drawingDoc.Sheets(1).DrawingViews.Count < 1 Then
MsgBox("Manual edit needed", MsgBoxStyle.Exclamation)
Return True
Else
drawingDoc.Close
Return False
End If
End Function