I am trying to select a face that I gave a name previously. This face is within a part, within an assembly. This is the (stripped) code. It runs fine, but nothing gets selected in the viewport nor when I try to apply a mate to the selection (I get error swAddMateError_IncorrectSelections because nothing is selected). But I do get the right face in the swFace object, but somehow it does not get selected. I tried using a SelectionManager but without success.
Dim swApp As New SldWorks.SldWorks
Dim swModel As Object
Can anyone help me how to select the face properly? When I rewrite it to work within a SLDPRT, it works, so I think it is related to the fact that I import a component in an assembly. But I cannot think why Select4 should behave differently.
SolidworksApi macros