I recorded a macro which makes an assembly of two parts. but when i try to read it i have a runtime error 13 at the line:
<< Create ConcentricMateFeatureData
Set MateData = Part.CreateMateData (1) >>.
what does this mean and how to fix this error?
I put the macro and the 2 pieces I want to assemble.

Hello, It's likely that the selection of faces, before this line, is not correct.
You shouldn't use SelectByRay anywhere in the macro, since the result will never be accurate.
Take a look at 2015 SOLIDWORKS API Help - Add and Mate Component Example (VBA)
for a better way to add a component and add mate
To use SelectByID2: record a macro, select the face, stop the macro, open the macro, copy the SelectByID2 line
However the best way to select a face, is to loop through all the faces to find the one you want by comparing their area and/or the face's normal vector. With 2016 SOLIDWORKS API Help - GetFirstFace Method (IBody2) and 2016 SOLIDWORKS API Help - GetNextFace Method (IFace2)
thank you a lot. but when i use SelectByID2 how do I select the face? especially the left side which is not shown? thank you