Dim EWS As Worksheet = Nothing
EWS = aDoc.ComponentDefinition.iAssemblyFactory.ExcelWorkSheet
For Each f As Inventor.AssemblyConstraint In aDoc.ComponentDefinition.Constraints 'Удаляем лишние взаимосвязи основываясь на входящих элементах
If f.OccurrenceOne Is Nothing OrElse f.OccurrenceTwo Is Nothing OrElse f.Suppressed = True OrElse _
f.OccurrenceOne.Excluded = True OrElse f.OccurrenceTwo.Excluded = True OrElse _
f.OccurrenceOne.Suppressed = True OrElse f.OccurrenceTwo.Suppressed = True _
Then
f.Delete()
End If
Next
For Each f As Inventor.AssemblyConstraint In aDoc.ComponentDefinition.Constraints 'Удаляем взаимосвязи, которые исключены в таблице исполнений
Dim i As Long = 1
Dim k As Long
Do Until EWS.Cells(1, i).text = ""
If EWS.Cells(1, i).text = f.Name & ":Включить/Исключить" Then
k = oRow.Index + 1
If EWS.Cells(k, i).text = "Исключить" Then
f.Delete()
EWS.Columns(i).delete()
Exit Do
End If
End If
i = i + 1
Loop
Next