AnsweredAssumed Answered

How to change fontsize of general table position with API?

Question asked by Yong Ning on Apr 6, 2014
Latest reply on Apr 6, 2014 by Yong Ning

Hope ,change fontsize of general table




change this tips code ,the error result is




SolidWorks Forums: How to move the general table position with API?



Sub ll1()

   Dim swApp As SldWorks.SldWorks

   Dim swModel As SldWorks.ModelDoc2

   Dim swSelMgr As SldWorks.SelectionMgr

   Dim swTable As SldWorks.TableAnnotation

   Dim swAnn As SldWorks.Annotation, swTextFormat As TextFormat  

    Set swApp = Application.SldWorks

    Set swModel = swApp.ActiveDoc

    Set swSelMgr = swModel.SelectionManager

    Set swTable = swSelMgr.GetSelectedObject6(1, -1)    ''


    Set swAnn = swTable.GetAnnotation

    'swAnn.SetPosition 0.15, 0.2, 0

    With swAnn

       .Layer = "aa"

    End With

    Debug.Print swAnn.GetTextFormatCount


    For ii = 0 To swAnn.GetTextFormatCount

      Set swTextFormat = swAnn.GetTextFormat(ii)

      With swTextFormat

         Debug.Print .CharHeight  '→ result is Error

      End With

    Next ii

End Sub