This content has been marked as final. Show 2 replies
first view is sheet, you have to start with second view.
Option Explicit ' Select all annotations and set to use Document Font - 08/12/15 by Casparia Dim swApp As SldWorks.SldWorks Dim swModel As SldWorks.ModelDoc2 Dim swDraw As SldWorks.DrawingDoc Dim swView As SldWorks.View Dim swTextFormat As SldWorks.TextFormat Dim i As Long Dim j As Long Dim annotations As Variant Dim notes As SldWorks.Annotation Dim count As Long Dim bool As Boolean Sub main() Set swApp = Application.SldWorks Set swModel = swApp.ActiveDoc Set swDraw = swModel ' Iterate through all the views on the drawing to find annotations Set swView = swDraw.GetFirstView Set swView = swView.GetNextView Do While Not swView Is Nothing Debug.Print swView.Name count = swView.GetAnnotationCount ' Iterate through all the annotations in each drawing view that has them and set to use document font If count > 0 Then annotations = swView.GetAnnotations For j = 0 To UBound(annotations) Set notes = annotations(j) bool = notes.SetTextFormat(i, True, swTextFormat) Next j End If Set swView = swView.GetNextView Loop End Sub
That was the problem, it works perfect now. Thanks so much for your help!