AnsweredAssumed Answered


Question asked by Yong Ning on Jun 1, 2017
Latest reply on Jun 2, 2017 by Yong Ning

follow code, create sketchpoint is x=50,y=20


Help me, point coordinate is   x=25,y = 10






Private Sub del20170601()

    Dim SwApp As SldWorks.SldWorks, SwModel As ModelDoc2

        Set SwApp = Application.SldWorks

        Set SwModel = SwApp.ActiveDoc

    Dim SwDraw As DrawingDoc

        Set SwDraw = SwModel

    Dim Xx, Yy


    Dim SwSelMgr As SelectionMgr

        Set SwSelMgr = SwModel.SelectionManager


    Dim SwDim As Dimension

    Dim SwDispDim As DisplayDimension, SwAnn As Annotation

    Dim vEntArr, vEntTypeArr

    Dim SkPt As SketchPoint


        Set SwDispDim = SwSelMgr.GetSelectedObject5(1)

        If Not SwDispDim Is Nothing Then

             Set SwAnn = SwDispDim.GetAnnotation

             vEntArr = SwAnn.GetAttachedEntities

             vEntTypeArr = SwAnn.GetAttachedEntityTypes


                For jj = 0 To UBound(vEntTypeArr)

                        Set SwPt = vEntArr(jj)

                        With SwPt

                            Xx = .X

                            Yy = .Y

                            Set SkPt = SwModel.CreatePoint2(Xx, Yy, 0)'????????

                        End With

                Next jj

         End If


End Sub