2 Replies Latest reply on Jul 8, 2016 11:21 AM by Sanya Shmidt

    How to get a StructuralMember name by choosing the face on the screen?

    Sanya Shmidt

      Hello Guys!

      Can someone help me here .

       

      I need to get a Structural Member Name, what I have so far gives me a name if I choose it on the feature tree, if I choose the face in the model it doesnt work.

      I guess I need to find a parent of the selected face/feature. Any ideas?

       

      Dim swApp As Object

      Dim Part As Object

      Dim swSelMgr As SldWorks.SelectionMgr

      Dim swFeat As SldWorks.Feature

      Dim boolstatus As Boolean

       

       

      Sub main()

      Set swApp = Application.SldWorks

      Set Part = swApp.ActiveDoc

      Set swSelMgr = Part.SelectionManager

      Set swFeat = swSelMgr.GetSelectedObject6(1, -1)

       

       

      MsgBox (swFeat.Name)