AnsweredAssumed Answered

traverse Sketch → How to get "Arc1@Sketch" ?

Question asked by Yong Ning on Aug 20, 2014
Latest reply on Aug 29, 2014 by Yong Ning

macro recorded → result.

boolstatus = Part.Extension.SelectByID2("Arc1@Sketch", "EXTSKETCHSEGMENT", 0, 0, 0, False, 0, Nothing, 0)

 

*************************

Traverse Sketch → gettype

Private Sub ll1()

  Dim SwApp As SldWorks.SldWorks, SwModel As ModelDoc2

    Set SwApp = Application.SldWorks

    Set SwModel = SwApp.ActiveDoc

  Dim SwSelMgr As SelectionMgr, SwFeat As Feature

    Set SwSelMgr = SwModel.SelectionManager

    Set SwFeat = SwSelMgr.GetSelectedObject5(1)

  Dim SwSketch As Sketch, SkSegArr, SkSeg As SketchSegment

    Set SwSketch = SwFeat.GetSpecificFeature

    SkSegArr = SwSketch.GetSketchSegments

    For ii = 0 To UBound(SkSegArr)

      Set SkSeg = SkSegArr(ii)

      Debug.Print SkSeg.GetType, Round(SkSeg.GetLength, 6)

      SkSeg.Select2 True, 1

    Next

End Sub

 

Help me

Traversing sketch → How to get "Arc1@Sketch" style.

Outcomes