2 Replies Latest reply on Mar 18, 2015 12:19 AM by Manikandan Babu

    Macro to measure distance between the lines by selecting  the sketch

    Manikandan Babu

      Dear all,

       

                By selecting the sketch,i have to measure distance between the every two lines to find out the gap in all area through macro.

            

      Option Explicit

      Dim swApp As SldWorks.SldWorks

      Dim swmodel As SldWorks.ModelDoc2

      Dim swsel As SldWorks.SelectionMgr

      Dim swfeature As SldWorks.Feature

      Dim swsketch As SldWorks.Sketch

      Dim SWSKETchSEG As SldWorks.SketchSegment

      Dim SWSEG As Variant

      Dim i As Integer

      Sub main()

      Set swApp = Application.SldWorks

      Set swmodel = swApp.ActiveDoc

      Set swsel = swmodel.SelectionManager

      Set swfeature = swsel.GetSelectedObject6(1, -1)

      Set swsketch = swfeature.GetSpecificFeature2

      SWSEG = swsketch.GetSketchSegments

      For i = 0 To UBound(SWSEG)

      Set SWSKETchSEG = SWSEG(i)

      Next

      End Sub

       

      Please help me out of this.

       

       

      Thanks in advance,

      Manikandan