1 Reply Latest reply on Aug 16, 2013 4:31 PM by Chris Johnson

    Multi-Select using GetObjectByPersistReference3

    Chris Johnson

      Hi All,

       

      So Im wanting to multi select two circles and add a dimension between them (basicly a wall thickness dimension) but Im not sure how to add both selections to the selection manager. Originally I was  going to simply select the first circle and then the second, thinking this would add them both to the selection manager.

       

      Im kinda thinking this may require an array but I have zero experience with arrays....how would you suggest multi-selecting sketches from persistent ID?

       

       

      'Add Wall thickness Dimension

          'Re-select OD sketch Segment

              Set swSketchSeg = swModel.Extension.GetObjectByPersistReference3(ODSketch, Empty)

              swSketchSeg.Select2 False, Empty

          'Re-Select ID Sketch Segment

              Set swSketchSeg = swModel.Extension.GetObjectByPersistReference3(IDSketch, Empty)

              swSketchSeg.Select2 False, Empty

       

      thanks

      Chris

        • Re: Multi-Select using GetObjectByPersistReference3
          Chris Johnson

          NM,

          I figured it out....

           

          Set swSelMgr = swModel.SelectionManager

                  Set swSelData = swSelMgr.CreateSelectData

                  Set swSketch = swModel.GetActiveSketch2

                  vSketchSeg = swSketch.GetSketchSegments

                  For i = 0 To UBound(vSketchSeg)

                  Set swSketchSeg = vSketchSeg(i)

                  vSketchSegID = swSketchSeg.GetID

                  bRet = swSketchSeg.Select4(True, swSelData)

                  Next