Update:
This is the code I have so far. Still struggling to assign text size and line spacing. It appears the text size is being driven by a percentage rather than the actual size. The line spacing is acting rather unpredictably.
I'm sure this isn't the best way to go about it.
SyntaxEditor Code Snippet
Sub Main()
Call DeleteNote()
Call AddNote()
End Sub
Sub DeleteNote()
Dim invApp As Inventor.Application
invApp = ThisApplication
Dim oDrawDoc As Document
oDrawDoc = invApp.ActiveEditDocument
For Each oSheet In oDrawDoc.Sheets
For Each oGeneralNote In oSheet.DrawingNotes.GeneralNotes
oGeneralNote.Delete
Next
Next
End Sub
Sub AddNote()
Dim invApp As Inventor.Application
invApp = ThisApplication
Dim oDrawDoc As Document
oDrawDoc = invApp.ActiveEditDocument
Dim oTG As Inventor.TransientGeometry = invApp.TransientGeometry
oModelDoc = IO.Path.GetFileName(ThisDrawing.ModelDocument.FullFileName)
oFrame = Parameter(oModelDoc, "frame")
oEng = Parameter(oModelDoc, "engine")
For Each oSheet In oDrawDoc.Sheets
Dim Ycoord = 20
Dim Xcoord = 8
Dim LS = 0.65
oNote = oSheet.DrawingNotes.GeneralNotes.AddFitted(oTG.CreatePoint2d(oSheet.Width -Xcoord, Ycoord), "Model " & oFrame & " Customer Selected Options")
With oNote
.HorizontalJustification = Inventor.HorizontalTextAlignmentEnum.kAlignTextCenter
.VerticalJustification = Inventor.VerticalTextAlignmentEnum.kAlignTextMiddle
' .TextStyle.FontSize = 0.305
.TextStyle.FontSize = 0.254
End With
If oEng = "ford" Then
Ycoord = Ycoord - LS
oNote = oSheet.DrawingNotes.GeneralNotes.AddFitted(oTG.CreatePoint2d(oSheet.Width - Xcoord, Ycoord), "2.5L Ford Engine")
ElseIf oEng = "cat 49.5hp" Then
Ycoord = Ycoord - LS
oNote = oSheet.DrawingNotes.GeneralNotes.AddFitted(oTG.CreatePoint2d(oSheet.Width - Xcoord, Ycoord), "Cat 49.5HP Diesel Engine")
ElseIf oEng = "cat 60hp" Then
Ycoord = Ycoord - LS
oNote = oSheet.DrawingNotes.GeneralNotes.AddFitted(oTG.CreatePoint2d(oSheet.Width - Xcoord, Ycoord), "Cat 60HP Turbo Diesel Engine")
End If
oDrawDoc.Update()
Next
End Sub