I try a macro but It doesn't work
Sub Interference()
Dim swApp As SldWorks.SldWorks
Dim swModel As SldWorks.ModelDoc2
Dim swAssembly As SldWorks.AssemblyDoc
Dim swModelExt As SldWorks.ModelDocExtension
Dim swComp As SldWorks.Component2
Dim swComp1 As SldWorks.Component2
Dim swBody As SldWorks.Body2
Dim swModeler As SldWorks.Modeler
Sun swSelMgr As SldWorks.SelectionMgr
Dim CompArray() As SldWorks.Component2
Dim swSelData As SldWorks.SelectData
Declaration of variables
Dim OutputPath As String
Dim OutputFN As String
Dim Component As Variant
Dim Component1 As Variant
Dim Components As Variant
Dim Components1 As Variant
Dim Deselection As Boolean
Dim Deselection1 Ace Boolean
Dim arrBody As Variant
Dim arrFace As Variant
Dim arrBody1 As Variant
Dim arrFace1 As Variant
Dim a As Boolean
Dim i as Integer
Dim i1 As Integer
Sun j As Long
Dim k As Integer
Dim k1 As Integer
Dim Interference As Boolean
Dim bRet As Boolean
Cell1 = 1
Set swApp = Application.SldWorks
Set swModeler = swApp.GetModeler
'Use the active document
Set swModel = swApp.ActiveDoc
Set swAssembly = swModel
Set swModelExt = swModel.Extension
Set swSelMgr = swModel.SelectionManager
Set swSelData = swSelMgr.CreateSelectData
Components = swAssembly.GetComponents(False)
Components1 = swAssembly.GetComponents(False)
' for each component (part) in the parts collection (Assembly)
For Each Component In Components
Set swComp = Component
If swComp.GetSuppression <> 0 Then
arrBody = swComp.GetBodies2(0)
End If
For i = 0 To UBound(arrBody)
Set swBody = arrBody(i)
arrFace = swBody.GetFaces
For k = 0 TB UBound(arrFace)
Set swFace = arrFace(k)
Set swEnt = swFace
a = swEnt.Select4(True, swSelData)
For Each Component1 In Components1
Set swComp1 = Component1
If swComp1.GetSuppression <> 0 Then
arrBody1 = swComp1.GetBodies2(0)
End If
For i1 = 0 To UBound(arrBody1)
Set swBody1 = arrBody1(i)
arrFace1 = swBody1.GetFaces
For k1 = 0 TB UBound(arrFace1)
Set swFace1 = arrFace1(k1)
Set swEnt1 = swFace1
a1 = swEnt1.Select4(True, swSelData)
Interference = swModeler.ICheckInterference3(swFace, swFace1, Nothing)
Debug.Print "Interference"; Interference
If swModel.GetEntityName(swFace) <> swModel.GetEntityName(swFace1) Then
DeselectionFace = swEnt1.DeSelect()
End If
Next k1
Next i1
Next Component1
DeselectionFace1 = swEnt.DeSelect()
Next k
Next i
Next Component
End Sub