Quantcast
Channel: PTC Community : Unanswered Discussions - Creo
Viewing all articles
Browse latest Browse all 8685

insert drawing note at specific location

$
0
0

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


Viewing all articles
Browse latest Browse all 8685

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>