I would like to set the FormattedText of the LeaderNote to something like:
"<Property Document='model' PropertySet='Design Tracking Properties' Property='Part Number' FormatID='{32853F0F-3444-11D1-9E93-0060B03C1CA6}' PropertyID='5'>PART NUMBER</Property>"
Is there a way to do this? Yes, the code below show a sample.
Sub CreateLN()
If m_inventorApplication.Documents.Count = 0 Then Exit Sub
If m_inventorApplication.ActiveDocument.DocumentType _
<> DocumentTypeEnum.kDrawingDocumentObject Then Exit Sub
Dim oDoc As DrawingDocument
oDoc = m_inventorApplication.ActiveDocument
Dim s As String
s = "<Property Document='model' " _
& "PropertySet='Design Tracking Properties' " _
& "Property='Part Number' " _
& "FormatID='{32853F0F-3444-11D1-9E93-0060B03C1CA6}' " _
& "PropertyID='5'>PART NUMBER</Property>"
' Create a DrawingView on this Sheet and
' the first DrawingCurve is line curve.
Dim oGI As GeometryIntent
oGI = oDoc.ActiveSheet.CreateGeometryIntent( _
oDoc.ActiveSheet.DrawingViews(1). _
DrawingCurves.Item(1), _
PointIntentEnum.kStartPointIntent)
Dim oObjCol As ObjectCollection
oObjCol = m_inventorApplication.TransientObjects. _
CreateObjectCollection
oObjCol.Add(oGI)
Dim oLN As LeaderNote
oLN = oDoc.ActiveSheet.DrawingNotes. _
LeaderNotes.Add(oObjCol, s)
End Sub