AnsweredAssumed Answered

How to select two dimension?

Question asked by Yong Ning on Dec 3, 2016
Latest reply on Dec 4, 2016 by Ivana Kolin

        Set SwAnn = SwDispDim.GetAnnotation

        Set SwAnn1 = SwDispDim.GetAnnotation

 

        Debug.Print SwAnn.GetName, SwAnn1.GetName → result → D3=D3

 

help me. How to select two dimension.

 

0.jpg

 

Private Sub del20161203()

   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, SwDispDim1 As DisplayDimension

       Set SwDispDim = SwSelMgr.GetSelectedObject5(1)

       Set SwDispDim1 = SwSelMgr.GetSelectedObject5(2)

      

       DimCoordinate SwDispDim, SwDispDim1

      

      

End Sub

 

 

 

 

Function DimCoordinate(SwDispDim As DisplayDimension, SwDispDim1 As DisplayDimension)

    Dim SwAnn As Annotation, SwAnn1 As Annotation

    Dim Ss, Ss1

   

        Set SwAnn = SwDispDim.GetAnnotation

        Set SwAnn1 = SwDispDim.GetAnnotation

        Debug.Print SwAnn.GetName, SwAnn1.GetName

        Ss = SwAnn.GetPosition

        Ss1 = SwAnn.GetPosition

       

        Stop

   

End Function

Attachments

Outcomes