AnsweredAssumed Answered

Have feature name→ how to get mate name?

Question asked by Yong Ning on Mar 19, 2015
Latest reply on Sep 29, 2016 by Yong Ning



follow code result is

   *********  Coincident1   MateCoincident

   *********  Coincident2   MateCoincident

   *********  Coincident4   MateCoincident


Help me


Feature name is Coincident1 →

    hope get mate name → Coincident → (b<1>,a<1>)




Private Sub MateFeat()

   Dim SwApp As SldWorks.SldWorks, SwModel As ModelDoc2

      Set SwApp = Application.SldWorks

      Set SwModel = SwApp.ActiveDoc

   Dim SwFeat As Feature, SwSubFeat As Feature

      Set SwFeat = SwModel.FirstFeature

      Do While Not SwFeat Is Nothing

         'Debug.Print SwFeat.Name, SwFeat.GetTypeName

         Set SwSubFeat = SwFeat.GetFirstSubFeature

         Do While Not SwSubFeat Is Nothing

            With SwSubFeat

               If .GetTypeName Like "*Mate*" Then

                  Debug.Print "   ********* ", .Name, .GetTypeName

               End If

               Set SwSubFeat = .GetNextSubFeature

            End With


         Set SwFeat = SwFeat.GetNextFeature



End Sub