NX API Getting Started : Adding your own UI to remove journal selection stickiness

NX API Getting Started : Adding your own UI to remove journal selection stickiness

When you record a journal the generated code contains hard-coded references to
any NX objects that you selected rather than code which would put up the UI to
have the end user do the selection.  This is by design and we refer to it as
"Selection Stickiness".

Look for any lines which contain the word "FindObject".  These are the lines
you will need to replace unless your program will always be starting in the
same part at the same state it was in when you recorded it.

To simply prompt the user to select one or more objects, you can use the
various methods on the NXOpen > Selection class that start with the word Select
such as SelectTaggedObject(s).  


If you want to do a more complex UI similar to those seen in NX, then you will
want to use the Block UI Styler or the older UIStyler.  These require a
separate NX Open Dialog Designers license so make sure you can save your
dialog before you spent a lot of time making it!

You can also use Winforms or Java Swing to create your UI if you know how to do
that.  These are not Siemens products so GTAC cannot help you with that.
    • Related Articles

    • NX API Getting Started : How do I find out what NXOpen class or method I need

      Record a journal of the interactive steps that you want to automate. If you are trying to find out what class/method/property to use to access a piece of information such as a value, try recording a journal of the interactive steps that you would use ...
    • NX CAE - Customized Application Using NX Open

      Hi, Please find the youtube video link below which demonstrate this application. http://www.youtube.com/watch?v=3I0fKw2QbWE&feature=youtu.be Please check on the attached data if you are interested to use the customed app in this video. Cheers, Tuw
    • Sample NX Open Java routine : select an edge

      public static TaggedObject selectAnEdge(String prompt) throws NXException, java.rmi.RemoteException { UI theUI = (UI) SessionFactory.get("UI"); Selection.MaskTriple mask[] = { new Selection.MaskTriple( UFConstants.UF_solid_type, 0, ...
    • Sample NX Open .NET C# routine : select a feature

      public static NXOpen.Features.Feature select_a_feature(string prompt) { Selection.SelectionType[] feats = { Selection.SelectionType.Features }; TaggedObject theTO; Point3d cursor; Selection.Response resp = ...
    • Sample NX Open .NET Visual Basic routine : select a component

      Imports System Imports NXOpen Imports NXOpen.Assemblies Imports NXOpenUI Imports NXOpen.UF Function select_a_component(ByRef obj As Component) As Selection.Response Dim ui As UI = UI.GetUI() Dim mask(0) As Selection.MaskTriple With mask(0) .Type = ...