Bonjour à tous,
J'ai un problème assez urgent à résoudre:
Je travail sous SolidWorks et j'ai besoin d'intégrer sous VisualBasic une pièce dans un assemblage. Voici le code:



Part.AddComponent "Adresse", 0, 0, 0
Part.UnfixComponent

boolstatus = Part.Extension.SelectByID2("Milieu de la voie@Assemblage d'une voie-1@NomAssemblage", "PLANE", -0.01938780520271, 7.194730192831, -1.101482557233, False, 0, Nothing, 0)
boolstatus = Part.Extension.SelectByID2("Plan de face", "PLANE", -15.37098585184, 6.655796587039, 0.03905236127034, True, 1, Nothing, 0)
Set Feature = Part.AddMate2(5, 1, False, 3, 3, 3, 1, 1, 1.570796326795, 0.5235987755983, 0.5235987755983, longstatus)
Part.ClearSelection2 True

boolstatus = Part.Extension.SelectByID2("Plan de droite", "PLANE", 0, 0, 0, False, 0, Nothing, 0)
boolstatus = Part.Extension.SelectByID2("Axe Support@Assemblage d'une voie-1@NomAssemblage", "PLANE", 0, 0, 0, True, 0, Nothing, 0)
Set Feature = Part.AddMate2(0, 0, False, 1.630246055344, 0, 0, 1, 1, 0, 0.5235987755983, 0.5235987755983, longstatus)
Part.ClearSelection2 True

boolstatus = Part.Extension.SelectByID2("P.M.R.", "PLANE", -1.549116855992, 0.1450853863592, 16.68903474345, False, 0, Nothing, 0)
boolstatus = Part.Extension.SelectByID2("P.M.R.@Assemblage d'une voie-1@NomAssemblage", "PLANE", 0, 0, 0, True, 0, Nothing, 0)
Set Feature = Part.AddMate2(0, 0, False, 5.944312966843, 0, 0, 1, 1, 0, 0.5235987755983, 0.5235987755983, longstatus)
Part.ClearSelection2 True

boolstatus = Part.Extension.SelectByID2("P.M.R.", "PLANE", -1.549116855992, 0.1450853863592, 16.68903474345, False, 0, Nothing, 0)
boolstatus = Part.Extension.SelectByID2("P.M.R.@Assemblage d'une voie-1@NomAssemblage", "PLANE", 0, 0, 0, True, 0, Nothing, 0)
boolstatus = Part.Extension.SelectByID2("Coïncidente3", "MATE", 0, 0, 0, False, 0, Nothing, 0)
Part.ClearSelection2 True

Part.ShowNamedView2 "*Gauche", 3

Le problème c'est que à la fin il n'y a aucun problème, mais la pièce ne s'insert pas. Quel est le problème ?

Merci beaucoup...