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
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 ?
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 Modulewww.nxjournaling.com
RE: Display "hidden text" from note on screen ?
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
RE: Display "hidden text" from note on screen ?
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