AnsweredAssumed Answered

SelectByID2→delete line,SketchSeg.Select→don't delete line?

Question asked by Yong Ning on Dec 11, 2016
Latest reply on Dec 12, 2016 by Yong Ning

SelectByID2 can be delete line. follow code is

 

boolstatus = Part.ActivateView("bb")

boolstatus = Part.Extension.SelectByID2("Line3", "SKETCHSEGMENT", 0, 0, 0, False, 0, Nothing, 0)

boolstatus = Part.Extension.SelectByID2("Line2", "SKETCHSEGMENT", 0, 0, 0, True, 0, Nothing, 1)

boolstatus = Part.Extension.SelectByID2("Line1", "SKETCHSEGMENT", 0, 0.1570691751775, 0, True, 0, Nothing, 1)

boolstatus = Part.Extension.SelectByID2("Line4", "SKETCHSEGMENT", 0, 0.1992614229289, 0, True, 0, Nothing, 1)

Part.EditDelete

 

 

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

SwSketchSeg.Select True,        SwDraw.EditDelete

 

Error.jpg

 

   Dim SwSketch As Sketch

        Set SwSketch = SwView.GetSketch

   Dim vSketchSeg, SwSketchSeg As SketchSegment

        vSketchSeg = SwSketch.GetSketchSegments

        ''

        For ii = 0 To UBound(vSketchSeg)

            Set SwSketchSeg = vSketchSeg(ii)

            SwSketchSeg.Select True

            SwDraw.DeleteSelection True

        Next ii

        SwDraw.EditDelete

Attachments

Outcomes