0 Replies Latest reply on Dec 26, 2016 5:29 PM by Yong Ning

    How to use ReferencePoints?

    Yong Ning

      Follow code result is error.

      x=0 y=0

      0             0             0

      1             0             0

      2             0             0







      Private Sub ll3()

         Dim SwApp As SldWorks.SldWorks, SwModel As ModelDoc2

             Set SwApp = Application.SldWorks

             Set SwModel = SwApp.ActiveDoc

         Dim SwSelMgr As SelectionMgr

             Set SwSelMgr = SwModel.SelectionManager

         Dim SwDispDim As DisplayDimension, SwDim As Dimension, Str

             Set SwDispDim = SwSelMgr.GetSelectedObject5(1)

             Set SwDim = SwDispDim.GetDimension

             Debug.Print SwDim.GetReferencePointsCount, SwDim.FullName

         Dim SwMath As MathUtility

             Set SwMath = SwApp.GetMathUtility

             'Debug.Print SwDim.FullName

         Dim SwEdge As Edge, SwEnty As Entity

         Dim SwAnn As Annotation

         Dim SwMathPt As MathPoint, Xx, Yy

             Ss = SwDim.ReferencePoints

             For ii = 0 To SwDim.GetReferencePointsCount - 1

                Set SwMathPt = SwMath.CreatePoint(Ss(ii))

                Xx = SwMathPt.ArrayData(0)

                Yy = SwMathPt.ArrayData(1)

                Debug.Print ii, Xx, Yy

             Next ii


      End Sub



      Getting the location of display dimension lines... | SOLIDWORKS Forums  https://forum.solidworks.com/message/387499