AnsweredAssumed Answered

select Configuration name in userform

Question asked by Yong Ning on Oct 11, 2014
Latest reply on Oct 13, 2014 by Daniel Andersson

Private Sub CommandButton2_Click()

   With UserForm1

      .Hide

      ''   →  Select configuration (tree) → Msgbox → run → function tt()

      Stop

      .Show

   End With

 

End Sub

 

Function tt()

  Dim SwApp As SldWorks.SldWorks, SwModel As ModelDoc2

    Set SwApp = GetObject(, "SldWorks.Application")

    Set SwModel = SwApp.ActiveDoc

  Dim SwSel As SelectionMgr

    Set swSelMgr = SwModel.SelectionManager

  Dim sConfig As Configuration

    Set sConfig = swSelMgr.GetSelectedObject5(1)

    Debug.Print sConfig.Name

 

End Function

 

‘’

why can send  picture in forum.solidworks?

see picture →

How to Configurate in BOM of Parts with API? | SOLIDWORKS Forum

https://forum.solidworks.com/thread/83943

Outcomes