Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations SSS148 on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Display "hidden text" from note on screen ? 2

Status
Not open for further replies.

Toost

Mechanical
Jan 18, 2011
2,993
Hi All,
I'm editing drawing templates... ( Yes, ...)
Since we run in "managed mode" almost all the text in the drawing heads are mapped to an attribute, similar to <W@DB_PART_NAME> and when the template is used it will display the Part name, " abcd1234" or whatever.

Now I need to verify templates which i have received and should be imported into Teamcenter, and then the attribute mapping needs to be correct.
Thereby i either need to do Information - Object on each text and in the listing window find the mapped attribute, or double click the text and read the string in the note editor. Neither method gives an overview when there are a number of texts to check.

Is it possible, with the help of VB or similar "print"/ "display" the "<W@attribute>" next to the text object ?
( Yes i know, i need to learn some programming...)

We run NX7.5 at the moment.


Regards,
Tomas

 
Replies continue below

Recommended for you

Are we talking about tabular notes, stand-alone note objects, or a mixture?

The code below will work with stand-alone note objects, it will create a temporary text object above the note that will show the first line of the text editor text. Is this similar to what you are looking for?

Code:
Option Strict Off
Imports System
Imports NXOpen
Imports NXOpen.UF

Module Module1

    Sub Main()

        Dim theSession As Session = Session.GetSession()
        Dim theUfSession As UFSession = UFSession.GetUFSession
        Dim workPart As Part = theSession.Parts.Work

        For Each myNote As Annotations.Note In workPart.Notes

            Dim myNoteBuilder As Annotations.DraftingNoteBuilder = workPart.Annotations.CreateDraftingNoteBuilder(myNote)
            Dim editorText() As String = myNoteBuilder.Text.GetEditorText
            Dim noteText() As String = myNote.GetText

            Dim textHt As Double = myNote.GetLetteringPreferences.GetGeneralText.Size

            Dim view_tag As Tag
            Dim textCoordinates(2) As Double
            textCoordinates(0) = myNote.AnnotationOrigin.X
            textCoordinates(1) = myNote.AnnotationOrigin.Y + textHt
            textCoordinates(2) = 0
            Dim textColor As UFObj.DispProps
            textColor.color = UFConstants.UF_OBJ_OLIVE

            theUfSession.Disp.DisplayTemporaryText(view_tag, UFDisp.ViewType.UseWorkView, text:=editorText(0), text_coord:=textCoordinates, ref_point:=UFDisp.TextRef.Middlecenter, color:=textColor, char_size:=textHt * 1.75, hardware:=1)

        Next

    End Sub

End Module

www.nxjournaling.com
 
Cowski my friend,
do i need to tell you that i love you ?

This is 99% exactly what i was looking for, if it would also include tables... 100% :)


Regards,
Tomas
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor