hello,
i tried to add part into assembly parts and assembled it with it, so , i found how to add part , but, i had same problem when i tried to assembled it.
this is my algorithm :
swModel.ClearSelection2(True)
swDocExt = swModel.Extension()
MateName = "Concentric520" + strCompName
FirstSelection = "Point1@Origin@" + strCompName & "@" + AssemblyName
SecondSelection = "Point1@Origin@" + AssemblyName
boolstat = swDocExt.SelectByID2(FirstSelection, "CONCENTRIC", 0, 0, 0, True, 1, Nothing, swSelectOption_e.swSelectOptionDefault)
boolstat = swDocExt.SelectByID2(SecondSelection, "CONCENTRIC", 0, 0, 0, True, 1, Nothing, swSelectOption_e.swSelectOptionDefault)
matefeature = swAssemblyDoc.AddMate3(swMateType_e.swMateCONCENTRIC, swMateAlign_e.swMateAlignALIGNED, False, 0, 0, 0, 0, 0, 0, 0, 0, False, mateError)
swModel.ClearSelection2(True)
when i run it, it works without error but the part isn't assembled.
i tried to show the mateError : MsgBox(mateError) , it gives me : 4 as a result.
Can you help me please, and thanks.
SolidworksApi/macros