×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Display "hidden text" from note on screen ?
2

Display "hidden text" from note on screen ?

Display "hidden text" from note on screen ?

(OP)
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

RE: Display "hidden text" from note on screen ?

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

RE: Display "hidden text" from note on screen ?

(OP)
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% smile


Regards,
Tomas

RE: Display "hidden text" from note on screen ?

Quote (Toost)

do i need to tell you that i love you?

heartHappy Valentine's Day, Toost!heart

The code linked above should also handle tabular notes. I'd like to revisit the code to tighten it up, but it is a start.

www.nxjournaling.com

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources