0 Replies Latest reply on Aug 19, 2014 3:37 AM by Manikandan Babu

    how to place a block over coincident sketch relation using macro

    Manikandan Babu

      Please guide me how to do this

       

      Option Explicit

      Sub main()

          Dim swApp                           As SldWorks.SldWorks

          Dim swModel                         As SldWorks.ModelDoc2

          Dim swSelMgr                        As SldWorks.SelectionMgr

          Dim swFeat                          As SldWorks.Feature

          Dim swSketch                        As SldWorks.Sketch

          Dim swSkRelMgr                      As SldWorks.SketchRelationManager

          Dim vSkRelArr                       As Variant

          Dim swSkRel                         As SldWorks.SketchRelation

          Dim relType                         As Long

          Dim i                               As Long

          Set swApp = Application.SldWorks

          Set swModel = swApp.ActiveDoc

          Set swSelMgr = swModel.SelectionManager

          Set swFeat = swSelMgr.GetSelectedObject5(1)

          Set swSketch = swFeat.GetSpecificFeature2

          Set swSkRelMgr = swSketch.RelationManager

        vSkRelArr = swSkRelMgr.GetRelations(swAll)

              For i = 0 To UBound(vSkRelArr)

              Set swSkRel = vSkRelArr(i)

              relType = swSkRel.GetRelationType
                     If relType =  "swConstraintType_COINCIDENT"  then
              Debug.Print relType
           End If
          Next i

           End Sub