@BDCollett
The original code was for the active sheet. I don't use multi sheet drawings so i didn't pay attentions to that ;-).
So if you use multiple sheets you can change the oSheet definition from a fixed one to one of the sheets collection. so you need a new "for each" statement. in the beginning.
I have update the code a little bit so it now loops thru the sheets. I also put a check in the views loop, because only flatpatternviews contains bendlines ("If oView.IsFlatPatternView Then"). So we can skip all other views.
Sub Main
Dim oDoc As DrawingDocument
Dim oSheet As Sheet
Dim oView As DrawingView
Dim oCurve As DrawingCurve
Dim oBendNote As BendNote
Dim oBendNoteExist As Boolean
oDoc = ThisApplication.ActiveDocument
For Each oSheet In oDoc.Sheets
For Each oView In oSheet.DrawingViews
'check if view is Flatpattern
If oView.IsFlatPatternView Then
' Find Bend lines
For Each oCurve In oView.DrawingCurves
If oCurve.EdgeType = Inventor.DrawingEdgeTypeEnum.kBendDownEdge _
Or oCurve.EdgeType = Inventor.DrawingEdgeTypeEnum.kBendUpEdge Then
oBendNoteExist = False
For Each oBendNote In oSheet.DrawingNotes.BendNotes
If oCurve.StartPoint.IsEqualTo(oBendNote.BendEdge.StartPoint) _
And oCurve.MidPoint.IsEqualTo(oBendNote.BendEdge.MidPoint) _
And oCurve.EndPoint.IsEqualTo(oBendNote.BendEdge.EndPoint) Then
oBendNoteExist = True
Call ChangeText(oBendNote)
Exit For
End If
Next
' Create the bend note
If oBendNoteExist = False Then
oBendNote = oSheet.DrawingNotes.BendNotes.Add(oCurve)
Call ChangeText(oBendNote)
End If
End If
Next 'oCurve
End If
Next 'oView
Next 'osheet
InventorVb.DocumentUpdate()
End Sub
Sub ChangeText( oNote As BendNote)
'clear overrides (if any)
oNote.Hidevalue = False
oNote.Text = ""
'check direction and set note
If oNote.Text.Contains("DOWN") Then
oText = Replace(oNote.Text,"DOWN","Baixo")
oNote.Hidevalue = True
oNote.Text = oText
End If
If oNote.Text.Contains("UP") Then
oText = Replace(oNote.Text,"UP","Cima")
oNote.Hidevalue = True
oNote.Text = oText
End If
End Sub