cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X

insert drawing note at specific location

chotchkiss
1-Newbie

insert drawing note at specific location

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

    Try

        '======================================================================
        '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

    createSurfaceNote = note

End Function

I am grateful for any help on this.  Clay

1 REPLY 1

check if there is a method to move it. i know that there is one to move a view on the drawing.

Top Tags