Message 1 of 3

Not applicable
08-07-2018
08:49 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I want to create multiple leader notes that aren't attached to anything. If the first note is at coordinates (12.25,17.25), then the leader attachment point can be around (12.75,16.75). The following code creates the notes, but they are general notes with no leaders. How can I revise the code to add leaders?
SyntaxEditor Code Snippet
'The setup Dim invApp As Inventor.Application invApp = ThisApplication Dim oDrawDoc As DrawingDocument oDrawDoc = invApp.ActiveEditDocument Dim oActiveSheet As Sheet oActiveSheet = oDrawDoc.ActiveSheet 'Looks up existing placed assembly 'oModelDoc = IO.Path.GetFileName(ThisDrawing.ModelDocument.FullFileName) 'sets model parameter frame as oFrame 'oFrame = Parameter(oModelDoc, "frame") 'creates fake parameter for example purposes oFrame = "X" For Each oSheet In oDrawDoc.Sheets Dim Xcoord = 12.25 Dim Ycoord = 17.25 Dim LS = 0.4 Dim oTG As Inventor.TransientGeometry = invApp.TransientGeometry oNote = oSheet.DrawingNotes.GeneralNotes.AddFitted(oTG.CreatePoint2d(oSheet.Width - Xcoord, Ycoord), "Model " & oFrame) Ycoord = Ycoord - LS oNote = oSheet.DrawingNotes.GeneralNotes.AddFitted(oTG.CreatePoint2d(oSheet.Width - Xcoord, Ycoord), "Note 2") oDrawDoc.Update() With oNote .HorizontalJustification = Inventor.HorizontalTextAlignmentEnum.kAlignTextCenter .VerticalJustification = Inventor.VerticalTextAlignmentEnum.kAlignTextMiddle .TextStyle.FontSize = 0.203 End With Next
Solved! Go to Solution.