Cancel
Showing results for 
Search instead for 
Did you mean: 

How to edit appended text of multiple dimensions in NX9?

Gears Legend Gears Legend
Gears Legend

Hi All,

 

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?

 

Thanks!

Frank

Huysmans Metalen n.v.
2x NX 11.0.2.7 Mach Designer
on Win7 64bit
NX Beta Tester with focus on Sheet Metal
Command Finder is your friend
7 REPLIES

Re: How to edit appended text of multiple dimensions in NX9?

Siemens Phenom Siemens Phenom
Siemens Phenom

Appended Text can only be added to one dimension at a time.

John R. Baker, P.E. (ret)
EX-Product 'Evangelist'
Irvine, CA

Re: How to edit appended text of multiple dimensions in NX9?

Gears Legend Gears Legend
Gears Legend

Hi John,

 

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.

Huysmans Metalen n.v.
2x NX 11.0.2.7 Mach Designer
on Win7 64bit
NX Beta Tester with focus on Sheet Metal
Command Finder is your friend

Re: How to edit appended text of multiple dimensions in NX9?

Siemens Phenom Siemens Phenom
Siemens Phenom

Actually, you can add appended text to multiple dimensions in NX 9 by doing this:

 

  • Select one of the dimensions.
  • Right-click and choose Edit Appended Text.
  • Select any other dimensions to which you want to add the same text.
  • In the Appended Text dialog box, set the text location and then type the text you want added to the dimensions.  The text automatically appears appended to the dimensions.
  • Click Close when you're finished.

Re: How to edit appended text of multiple dimensions in NX9?

Legend
Legend

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

 

Frank Swinkels

Re: How to edit appended text of multiple dimensions in NX9?

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor

Not sure why, but I had to add a "Imports NXOpen" to Frank's code to get it to run as a journal.

Ken Akerboom Sr CAx Systems Engr, Moog, Inc.
Production: NX10.0.3.5 MP16/TC11.2
I'd rather be e-steamed than e-diseaseled


Re: How to edit appended text of multiple dimensions in NX9?

Legend
Legend

Yes my code did have that.  Just a slip of the copy command.

 

Frank Swinkels

Re: How to edit appended text of multiple dimensions in NX9?

Experimenter
Experimenter

Hello Frank

 

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

 

Werner