0 Replies Latest reply on Jul 11, 2014 9:16 AM by Rejo Jayaraj

    Trouble with SketchUseEdge2 in the assembly

    Rejo Jayaraj

      Hello friends,

       

      I am trying to convert sketch entities from one sketch of one component to sifferent sketch of a different componet in an assembly. I am not getting how to proceed. Codes written below is the one what I am trying out with but it fails.

       

      vSkContours = mysketch.GetSketchContours() '**** gets the countours from sketch of Component 1

      Set skContour = vSkContours(0)

      vSkSegments = skContour.GetSketchSegments()   '***************** gets all the segments from the first contour in the array

      .

      .

      .

      .

      .

       

      mymodel.SketchManager.DisplayWhenAdded = True

      mymodel.SketchManager.AddToDB = True        

      boolstatus = mymodel.Extension.SelectByID2("Front Plane", "PLANE", 0, 0, 0, False, 0, Nothing, 0)   '***** mymodel is modeldoc for 2nd component

      mymodel.SketchManager.InsertSketch True

       

      For J = 0 To UBound(vSkSegments)

                      Set swSketchSeg = vSkSegments(J)

                      ovalue = swSketchSeg.GetID

                      boolstatus = swSketchSeg.Select(True)

                      'myModel.EditSketch

                      boolstatus = mymodel.SketchManager.SketchUseEdge2(False)

                      mymodel.ClearSelection2 True

      Next J

      mymodel.SketchManager.InsertSketch True

       

      I am not sure if this is the approach I need to be taking, could someone guide me on this one. Any help is appreciated

       

      Thanks & Regards,

      Rejo