relation

Dear All,

I want to select block endpoint & line end point to form coincident relation

I am unable to do this.

please guide me for the same

snap settings  are on

here is code for your ref.

swModel.Extension.SelectByID2 s1, "SKETCHSEGMENT", 0, 0, 0, False, 0, Nothing, 0

        s1 = "Line" & "" & swSketchSeg.GetID(1)

        Set swSketchSegment = swselmgr.GetSelectedObject6(1, -1)

      

         

            Set swStartPt = swSketchSegment.GetStartPoint2

            Set swEndPt = swSketchSegment.GetEndPoint2

          

            x1 = 0

            y1 = 0

            x2 = 0

            y2 = 0

          

            x1 = (swStartPt.x)

            y1 = (swStartPt.y)

            x2 = (swEndPt.x)

            y2 = (swEndPt.y)

          

            ang = (swSketchSegment.Angle)

                    

            nPt(0) = x2

            nPt(1) = y2

            nPt(2) = 0

            vPt = nPt

Set swSketchBlockDef = swSketchMgr.MakeSketchBlockFromFile(swMathPoint, "C:\"test.SLDBLK", False, 1, ang)

swModel.Extension.SelectByID2 "", "SUBSKETCHINST", vPt(0), vPt(1), 0, False, 0, Nothing, 0

swModel.Extension.SelectByID2 "", "SKETCHPOINT", vPt(0), vPt(1), 0, False, 0, Nothing, 0

swModel.SketchAddConstraints "sgCOINCIDENT"

SolidworksApi macros