AnsweredAssumed Answered

GetNext but with a direction

Question asked by Matt Bieringer on Jul 25, 2017
Latest reply on Sep 22, 2017 by Matt Bieringer

Hello all,

Is it possible to use the .GetNext command but have it look in a direction instead of the next note or view that was added? Basically I am making a macro that will replace annotation text but I need it to search for the next annotation to the right, which might not have been the last annotation added. I attached an image of the order of progression that I need the macro to go in.

Thank you,



Below is my sub

Public Sub okclick()
Dim y As Long
Dim i As Long
    If IsNumeric(StartForm.TextBox1.Value) Then
        ID = StartForm.TextBox1.Value
        MsgBox "Start Number: " & ID
        Set swApp = Application.SldWorks
        Set swModel = swApp.ActiveDoc
        Set swDraw = swModel
        Set swView = swDraw.GetFirstView
        While Not swView Is Nothing
            Set swNote = swView.GetFirstNote
            While Not swNote Is Nothing
                If swNote.GetText Like "~~" Then
                    If swNote.GetText Like "~~" Then swNote.SetText ID
                    ID = ID + 1
                    Set swNote = swNote.GetNext()
                    Set swNote = swNote.GetNext
                End If
            Set swView = swView.GetNextView
    End If
    Unload StartForm
End Sub