NX9 Journal - Appended Text
NX9 Journal - Appended Text
(OP)
I know it is easy to add an appended text to a dimension, but when you get a lot of them, it becomes annoying. So I used to have macros where you could select a dimnsion, click an icon, and it would automatically add the appended text below the dimension. I had one for each note. (REF, START, TYP, etc...)
Unfortunately those macros are not working anymore and I am trying to do this with Journal now. (Journal is attached.)
The problems I have run into is...
1) It only worked on the same kind of dimensions. I believe I fixed this by removing the "Vertical" out of the code here ....
appendedTextEditorBuilder1 = workPart.Dimensions.CreateAppendedTextEditorBuilder(CType(theUI.SelectionManager.GetSelectedObject(0), Annotations.VerticalDimension))
2) After the journal plays back, it leaves the dimension that it added the Appended Text to hi-lighted and I manually have to hit the escape button to de-select it.
My QUESTIONS..... Can I add something to the code to force it to automatically de-select the dimension? AND is there a way to make this work for selecting multiple dimensions to add the appended text to in one swoop?
Clarification.... Right now I have it set up that I select the dimension, then run the Journal. I would prefer to keep it this way, but if I have to change it to where the journal tells me to select which dimensions to add the attribute to, that would be fine. Though I have not found a way to have User commands in the middle of the journal playback like in Macros.
Unfortunately those macros are not working anymore and I am trying to do this with Journal now. (Journal is attached.)
The problems I have run into is...
1) It only worked on the same kind of dimensions. I believe I fixed this by removing the "Vertical" out of the code here ....
appendedTextEditorBuilder1 = workPart.Dimensions.CreateAppendedTextEditorBuilder(CType(theUI.SelectionManager.GetSelectedObject(0), Annotations.VerticalDimension))
2) After the journal plays back, it leaves the dimension that it added the Appended Text to hi-lighted and I manually have to hit the escape button to de-select it.
My QUESTIONS..... Can I add something to the code to force it to automatically de-select the dimension? AND is there a way to make this work for selecting multiple dimensions to add the appended text to in one swoop?
Clarification.... Right now I have it set up that I select the dimension, then run the Journal. I would prefer to keep it this way, but if I have to change it to where the journal tells me to select which dimensions to add the attribute to, that would be fine. Though I have not found a way to have User commands in the middle of the journal playback like in Macros.





RE: NX9 Journal - Appended Text
There is currently no good way to deselect entities in a plain journal*; you might be able to get around this by using SendKeys to send an Esc keystroke to NX.
* - There are existing Enhancement Requests (ER's) to add such functionality. If you'd like to see this in future versions of NX, you can contact GTAC and have them add you to the list (ER 1785948 and ER 1663128).
If you change the approach to make the journal prompt the user to select dimensions, it will deselect the dimensions automatically when the journal completes.
Yes: query the number of currently selected objects, loop through the objects adding the appended text to the dimension objects (the user may have other object types selected which you will need to ignore).
p.s. I don't see any attachment.
www.nxjournaling.com
RE: NX9 Journal - Appended Text
CODE
'Amy Webster 'Date: 03/28/2011 'Subject: Sample NX Open .NET Visual Basic program : report type and subtype of preselected objects ' 'Note: GTAC provides programming examples for illustration only, and 'assumes that you are familiar with the programming language being 'demonstrated and the tools used to create and debug procedures. GTAC 'support professionals can help explain the functionality of a particular 'procedure, but we will not modify these examples to provide added 'functionality or construct procedures to meet your specific needs. Imports System Imports NXOpen Imports NXOpen.UF Imports NXOpenUI Module journal Sub Main Dim s As Session = Session.GetSession() Dim ufs As NXOpen.UF.UFSession = NXOpen.UF.UFSession.GetUFSession() Dim selobj As NXObject Dim type As Integer Dim subtype As Integer Dim lw As ListingWindow = s.ListingWindow Dim theUI As UI = ui.GetUI Dim numsel As Integer = theUI.SelectionManager.GetNumSelectedObjects() lw.Open() lw.WriteLine("Selected Objects: " & numsel.ToString()) For inx As Integer = 0 To numsel-1 selobj = theUI.SelectionManager.GetSelectedObject(inx) ufs.Obj.AskTypeAndSubtype(selobj.Tag, type, subtype) lw.WriteLine("Object: " & selobj.ToString()) lw.WriteLine(" Tag: " & selobj.Tag.ToString()) lw.WriteLine(" Type: " & type.ToString()) lw.WriteLine(" Subtype: " & subtype.ToString()) lw.WriteLine("") Next End Sub End Modulewww.nxjournaling.com
RE: NX9 Journal - Appended Text
I am currently trying to figure out how to have Journal prompt someone to select a dimension to add appended text to. I see the pause, the user pause and the comment, but I havent yet figured out what order and which ones to use. lol
RE: NX9 Journal - Appended Text
http://nxjournaling.com/content/adding-interactive...
http://nxjournaling.com/content/using-mask-triples...
www.nxjournaling.com
RE: NX9 Journal - Appended Text
Also, I had to add a section that cleared any appended text before it added the right text.
Attached is a ref after I made the changes. (Yes this time I am attaching it. lol) I am sure it could be cleaned up some bt it seems to work so far.