4 Replies Latest reply on Jan 15, 2019 7:56 AM by Deepak Gupta

    Delete Hidden Annotations

    Alex Lachance

      Hello,

       

      I've had a minor bug for quite some time and never really payed attention to it until I realized that it was making my drawings a little more heavier to work with. The bug is that I had hidden annotations that were never imported on some of the views on my drawings. I was wondering if there was a way to delete them besides showing them all one by one manually and then deleting them? It's a real hassle having to do so.

       

       

      Does anyone know what could cause this? These dimensions are generally model dimensions but we never import them from the model.

       

      Also, once in a while when I open one of the sheet with those hidden diemsniosn, a message will appear in the featuretree asking me if I would like to show the previously hidden annotations. Checked or unchecked, the dimensions never reappear unless I go to Show/Hide dimensions and show them manually.

       

       

      I've had this in 2014 SP5.0 and 2016 SP4.0

        • Re: Delete Hidden Annotations
          Deepak Gupta

          Not sure why you may be getting them but can try the following macro codes to delete them (the macro would delete all hidden annotations on the active sheet in the active drawing). Take a backup before using the macro codes.

           

          Option Explicit
            Dim swApp As SldWorks.SldWorks
            Dim swModel As ModelDoc2
            Dim swDraw As DrawingDoc
            Dim swView As View
            Dim swAnn As SldWorks.Annotation
          Sub main()
                Set swApp = Application.SldWorks
                Set swModel = swApp.ActiveDoc
                Set swDraw = swModel
                Set swView = swDraw.GetFirstView
          
                Do While Not swView Is Nothing
                      Set swAnn = swView.GetFirstAnnotation2           
                      Do While Not Nothing Is swAnn
                          If swAnn.Visible = swAnnotationHidden Then
                              swAnn.Select2 False, 0
                              swDraw.Extension.DeleteSelection2 swDelete_Absorbed
                          End If
                          Set swAnn = swAnn.GetNext2
                      Loop
                  Set swView = swView.GetNextView
                Loop
          End Sub
          

           

          Also check these SPRs 616074, 1098881 and 437947.