Automate Drawing Notes with iLogic

@ClintBrown3D Autodesk Inventor 10-min

Have you ever wanted to automatically create a drawing note on your Inventor drawing based on a pre-defined text file?

Look no further, I have written some iLogic code that will place a drawing note on your drawing in a pre-defined position. The note will contain the contents of a text file that you you specify. Simply edit the path shown below.

SetNotePath = "C:\TEMP\Notes.txt"

I have set up 4 positions for the notes in the code, and commented them out, so you should be able to quickly figure out how to position your notes to fit your drawing (see bottom of the iLogic rule)

The animated GIF below shows the iLogic rule in action:

iLogic notes dwg 748

'iLogic code by Clint Brown @ClintBrown3D
'Originally posted at

SetNotePath = "C:\TEMP\Notes.txt"

' This assumes a drawing document is active.
Dim oDrawDoc As DrawingDocument
 oDrawDoc = ThisApplication.ActiveDocument

'  a reference to the active sheet.
Dim oActiveSheet As Sheet
 oActiveSheet = oDrawDoc.ActiveSheet

'  a reference to the GeneralNotes object
Dim oGeneralNotes As GeneralNotes
 oGeneralNotes = oActiveSheet.DrawingNotes.GeneralNotes

Dim oTG As TransientGeometry
 oTG = ThisApplication.TransientGeometry

'----------READ IN DATA From TEXT File --------------------
oRead = System.IO.File.OpenText(SetNotePath)
EntireFile = oRead.ReadToEnd()
Dim sText As String	
sText = EntireFile 
'----------READ IN DATA From TEXT File --------------------

Dim oGeneralNote As GeneralNote
'oGeneralNote = oGeneralNotes.AddFitted(oTG.CreatePoint2d(3, 40), sText) 'Top Left
'oGeneralNote = oGeneralNotes.AddFitted(oTG.CreatePoint2d(50, 40), sText) 'Top Right
oGeneralNote = oGeneralNotes.AddFitted(oTG.CreatePoint2d(50, 8), sText) 'Bottom Right
'oGeneralNote = oGeneralNotes.AddFitted(oTG.CreatePoint2d(3, 6), sText) 'Bottom Left