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

 

 

 

01.jpg

 

 

 

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

    

     'SwModel.HideShowDimensions

     Debug.Print SwView.GetAnnotationCount

     'Stop

     Ss = SwView.GetAnnotations

     'Stop

     For ii = 0 To UBound(Ss)

        Set SwAnn = Ss(ii)

        SwAnn.Select True

        'Stop

        Debug.Print SwAnn.GetName

        SwAnn.Visible = 1

     Next ii

   

    Dim SwSheet As Sheet

       Set SwSheet = SwDraw.GetCurrentSheet

       Stop

       Ss = SwSheet.CustomPropertyView

      

End Sub

 

 

 

00.jpg

Outcomes