AnsweredAssumed Answered

Current Selection Sets in Dropdown Box

Question asked by Matt Clatworthy on Mar 22, 2019
Latest reply on Apr 2, 2019 by Matt Clatworthy


I am currently writing an API script for Solidworks, and I have been stuck all day trying to get the current Selection Sets  that are in the part file to show up in  a Combo box.


I have gotten the Model Configs to show up in a list box, but can’t figure out the Selection sets …  Here is my current code for the user form (I deleted everything that I have tried for the selection sets)….    The Combo box is called  ‘ComboBoxPin’


Any help would be great!!




Private Sub UserForm_Initialize()


    Dim swApp As SldWorks.SldWorks

    Dim swModel As SldWorks.ModelDoc2

    Dim configNames()  As String

    Dim configName As String

    Dim swConfig As SldWorks.Configuration

    Dim ii As Long






Set swApp = SolidWorks.SldWorks

Set swModel = swApp.ActiveDoc



configNames = swModel.GetConfigurationNames


    For ii = 0 To UBound(configNames)

        configName = configNames(ii)


        'Debug.Print configName

        Me.ListBox1.AddItem configName


    Next ii


End Sub