I use the following code to insert a drawing note onto a drawing, but I cannot figure out how to place it at a specific XY coordinate.
| Public Function createSurfaceNote(drawing As IpfcDrawing) As IpfcDetailNoteItem |
| | Dim text As IpfcDetailText |
| | Dim texts As CpfcDetailTexts |
| | Dim textLine As IpfcDetailTextLine |
| | Dim textLines As CpfcDetailTextLines |
| | Dim noteInstructions As IpfcDetailNoteInstructions |
| | Dim note As IpfcDetailNoteItem = Nothing |
| | '====================================================================== |
| | 'Allocate a text item and add it to a new text line |
| | '====================================================================== | |
| | text = (New CCpfcDetailText).Create("@[&sheet_name@]") |
| | texts = New CpfcDetailTexts |
| | texts.Insert(0, text) |
| | textLine = (New CCpfcDetailTextLine).Create(texts) |
| | textLines = New CpfcDetailTextLines |
| | textLines.Insert(0, textLine) |
| | '====================================================================== |
| | 'Allocate a note description and set its properties |
| | '====================================================================== |
| | noteInstructions = (New CCpfcDetailNoteInstructions).Create(textLines) |
| | '====================================================================== |
| | 'Create and display the note |
| | '====================================================================== |
| | note = drawing.CreateDetailItem(noteInstructions) |
| | note.Show() |
| | Catch ex As Exception |
| | MsgBox(ex.Message.ToString + Chr(13) + ex.StackTrace.ToString) |
| | End Try |
I am grateful for any help on this. Clay