AnsweredAssumed Answered

How to get GetAnnotations in Sheet format?

Question asked by Yong Ning on Jun 17, 2015
Latest reply on Jun 18, 2015 by Yong Ning

Why  don't find View in xxx.SldDrt file?



In Sheet Format, SwDraw.GetFirstView → don't find View → Ss = SwView.GetAnnotations → result is 0








Follow code is  swview.GetFirstView


Private Sub ll()

  Dim SwApp As SldWorks.SldWorks, SwModel As ModelDoc2

     Set SwApp = Application.SldWorks

     Set SwModel = SwApp.ActiveDoc

  Dim SwDraw As DrawingDoc, SwView As View

     Set SwDraw = SwModel

     Set SwView = SwDraw.GetFirstView

     Debug.Print SwView.GetName2,

     'Set SwView = SwView.GetNextView

     'Debug.Print SwView.GetName2

  Dim SwAnn As Annotation, Ss, ii



     Debug.Print SwView.GetAnnotationCount


     Ss = SwView.GetAnnotations


     For ii = 0 To UBound(Ss)

        Set SwAnn = Ss(ii)

        SwAnn.Select True


        Debug.Print SwAnn.GetName

        SwAnn.Visible = 1

     Next ii


    Dim SwSheet As Sheet

       Set SwSheet = SwDraw.GetCurrentSheet


       Ss = SwSheet.CustomPropertyView


End Sub