Being in the drafting application, what would be the fastest way of changing a standard dimension (without appended text) to a dimension WITH an appended text?
I know how to do it with a single dimension, but I can't figure out how to do it with multiple selected dimensions...
My goal is to record a journal that does it for me after I've selected the dimensions.
Can anyone point me in the good direction?
Solved! Go to Solution.
Thanks for looking into this.
I was just on the phone with GTAC and they will file an IR/ER on this.
I loose a lot of time every day not being able to do this in a quick way.
I have also been trying to predefine the desired appended text, but with a journal that doesn't work either because apparently a journal can't leave a dialog window open after completing...
And doing it manually is just too many clicks and too much mousetravel.
Actually, you can add appended text to multiple dimensions in NX 9 by doing this:
And here is a very simple journal which asks for the text required as after text and then select all the dimensions you wish to have this after appended text applied to.
Imports NXOpen.Annotations Imports NXOpenUI Imports NXOpen.UF Imports NXOpen.Utilities Module DimensionAppendedText Dim s As Session = Session.GetSession() Dim ui As UI = ui.GetUI() Dim wp As Part = s.Parts.Work() Sub Main() Dim response1 As Selection.Response = Selection.Response.Cancel Dim obj(-1) As TaggedObject Dim prompt As String = "Select Dimensions" Dim appendedstring As String = Nothing Dim prompt1 As String = "Enter Dimension Text" appendedstring = NXInputBox.GetInputString(prompt1) response1 = select_dimensions(prompt, obj) For Each dim1 As TaggedObject In obj SetDimensionAppendedtext(appendedstring, dim1) Next End Sub Function select_dimensions(ByVal prompt As String, ByRef obj() As TaggedObject) As Selection.Response Dim mask(0) As Selection.MaskTriple mask(0).Type = UFConstants.UF_dimension_type mask(0).Subtype = 0 mask(0).SolidBodySubtype = 0 Dim resp As Selection.Response = _ ui.SelectionManager.SelectTaggedObjects(prompt, prompt, _ Selection.SelectionScope.AnyInAssembly, False, False, obj) If resp = Selection.Response.ObjectSelected Or _ resp = Selection.Response.ObjectSelectedByName Then Return Selection.Response.Ok Else Return Selection.Response.Cancel End If End Function Public Sub SetDimensionAppendedtext(ByVal appendedtext As String, ByVal dim1 As Dimension) Dim appendedTextEditorBuilder1 As Annotations.AppendedTextEditorBuilder appendedTextEditorBuilder1 = wp.Dimensions.CreateAppendedTextEditorBuilder(dim1) Dim lines1(0) As String lines1(0) = appendedtext appendedTextEditorBuilder1.AppendedTextBuilder.SetAfter(lines1) Dim nXObject1 As NXObject nXObject1 = appendedTextEditorBuilder1.Commit() Dim objects1() As NXObject objects1 = appendedTextEditorBuilder1.GetCommittedObjects() End Sub Public Function GetUnloadOption(ByVal dummy As String) As Integer GetUnloadOption = NXOpen.Session.LibraryUnloadOption.Immediately End Function End Module
Note I only tested this for NX9
Not sure why, but I had to add a "Imports NXOpen" to Frank's code to get it to run as a journal.
Production: NX10.0.3.5 MP16/TC11.2
I'd rather be e-steamed than e-diseaseled
The Journal you made was very helpfull, but can you please explain how I can change it a bit?
I would like to have buttons for several different appended text (or symbols) and the option to select dimensions.
If I can change the pop-up dialog box for a standard text line (wich I can change for every new journal) it would be great!
I am using NX9