6 Replies Latest reply on Dec 16, 2014 5:23 PM by Drew Miller

    Using VBA pmp selectionbox question

    Drew Miller

      Hi,Using VBA, I have a propertymanagerpage.  The user interface allows selection of faces in a selectionbox object.  There are multiple faces selected.  How do I get the selected items from the selectionbox?  I have tried using object=pm_Selection.GetSelectedItems but doesn't look like its working.


      Dim swFeature  As SldWorks.Face2

              Dim varArray As Object

              Dim itemCount As Integer

              Dim varItem As Variant


              itemCount = pm_Selection.GetSelectedItemsCount

              Debug.Print "Number of items selected: " & itemCount


              Set varArray = pm_Selection.GetSelectedItems

              Set varItem = varArray(0)

      ' Get the face feature and use it in the next method

              ' Create the part and insert it as a virtual component

              ' in the assembly

              Status = swAssy.InsertNewVirtualPart(swFeature, swComponent)