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
Dim swSelMgr As SldWorks.SelectionMgr
Dim CompArray() As SldWorks.Component2
Dim swSelData As SldWorks.SelectData
'Déclaration des 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 As 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
Dim j As Long
Dim k As Integer
Dim k1 As Integer
Dim Interference As Boolean
Dim bRet As Boolean
Cellule1 = 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)
'pour chaque composant (pièce) de la collection de pièces (Assemblage)
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 To 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 To 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