Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
WCrihfield
in reply to: Guthery1

OK.  Here is a couple of code examples you can play around with in the mean time that may help.

This example creates a new GeneralNote on the active sheet of the active drawing, then changes its color to red.  It also shows how you can use the XML tag "<Br/>" for a line break within the text.

Dim oDDoc As DrawingDocument = TryCast(ThisDoc.Document, Inventor.DrawingDocument)
If oDDoc Is Nothing Then
	MsgBox("iLogic rule '" & iLogicVb.RuleName & "' was aborted - no DrawingDocument found.", vbCritical, "iLogic")
	Return
End If
Dim oSheet As Inventor.Sheet = oDDoc.ActiveSheet
Dim oGNotes As Inventor.GeneralNotes = oSheet.DrawingNotes.GeneralNotes
Dim oTG As TransientGeometry = ThisApplication.TransientGeometry
Dim oTO As TransientObjects = ThisApplication.TransientObjects
Dim oNewGNote As Inventor.GeneralNote = Nothing
Dim oPoint As Point2d = oTG.CreatePoint2d(4, 5)
Dim sFText As String = "Some<Br/>Example<Br/>Text"
oNewGNote = oGNotes.AddFitted(oPoint, sFText)
oNewGNote.Color = oTO.CreateColor(255, 0, 0) 'red

 This example allows you to either manually pre-select or pick (when the rule runs) an existing note in your drawing, then writes its FormattedText to the iLogic Log window for you, so you can review how it is currently formatted.

Dim oPickedNote As DrawingNote = Nothing
Dim oSS As Inventor.SelectSet = ThisDoc.Document.SelectSet
If oSS.Count > 0 AndAlso (TypeOf oSS.Item(1) Is DrawingNote) Then
	oPickedNote = oSS.Item(1)
Else
	oPickedNote = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kDrawingNoteFilter, "Pick a drawing note.")
End If
If oPickedNote Is Nothing Then Return
Logger.Info(vbCrLf & oPickedNote.FormattedText)

 

Wesley Crihfield

EESignature

(Not an Autodesk Employee)