4 Replies Latest reply on Mar 31, 2015 10:38 AM by Deepak Gupta

    How to get/set  the 2nd dimension text? (in SW 2015 SP2.1)

    Andreas Killer

      Hello,

       

      I'm not sure if "2nd dimension text" is the correct term, I mean "75h7" in this picture (red marked):

      Unbenannt.png

       

      I tried to use the GetText method but it seems that I can access only the 1st dimension text:

       

      Sub Test()
        Dim swApp As SldWorks.SldWorks
        Dim swFeat As SldWorks.Feature
        Dim swDispDim As SldWorks.DisplayDimension
        Dim swDim As SldWorks.Dimension
        Dim i As Long

       

        Set swApp = Application.SldWorks
        Set swModel = swApp.ActiveDoc
        Set swFeat = swModel.GetActiveSketch2
       
        Set swDispDim = swFeat.GetFirstDisplayDimension
        Do While Not swDispDim Is Nothing
          Set swDim = swDispDim.GetDimension
          Debug.Print swDim.FullName
          For i = 0 To 8
            Debug.Print i, swDispDim.GetText(i)
          Next
          'swDispDim.SetText x, "Whatever"
          Set swDispDim = swFeat.GetNextDisplayDimension(swDispDim)
        Loop
      End Sub

       

      Any ideas?

       

      Andreas.