NXKnowledge

NX Open Programmer's Guide > Block Styler Automation

Block Styler Automation

The Block Styler is an interactive tool for designing NX dialogs. Previous to the Block Styler, NX provided the User Interface Styler (UI Styler) for dialog creation. The Block Styler enhances the capabilities of the UI Styler by using the same set of reusable blocks currently used by internal NX applications. Using Blocks as the basic dialog building units ensures that NX has consistent behavior across all applications. By using the Block Styler your custom applications will share the same user interactions as used throughout NX. Furthermore, the Block Styler provides platform independent dialogs.

Note: The UI Styler is still provided to support legacy user interfaces. However, it is recommended that the Block Styler should be used for all new user interfaces or major changes to existing dialogs.

Why Use Blocks

The UI Styler defines dialogs composed of individual controls such as push buttons and input fields. The predefined behaviors of these are also sets of blocks that provide standard NX behaviours for actions that are common in graphical CAD/CAM/CAE applications. For instance, there is a Specify Vector block that is composed of a label, a standard NX vector constructor button, a pull down list for standard inferred vector options and a reverse direction toggle. This block is used throughout NX to let the user select or interactively define a vector. By using this block within your dialogs you save time by not having to implement the various options and you ensure that your application behaves as other NX applications.

Prerequisites

Before reading this section the reader is expected to already be familiar with building and running NX Open Journals and applications.

The reader is expected to understand how to use the Block Styler to create NX dialogs and how to save and edit dialogs that have been saved to .dlx files. Before attempting to connect a Block Dialog to an NX Open application the user is expected to understand how the Block Styler generates a template source code file that the developer edits to react with the dialog at runtime. You will modify this file to provide the unique interactions required for your application. This code will contain the methods used to read and load the DLX file and all of the methods that will react to user and system events.

The Block Styler provides various options to customize the template code. The details of how these options are used is discussed throughout this section. See the Block Styler users guide for a summary of the code generation options. One of the fundamental options is the selection of your target language. The Block Styler is capable of generating template code for all NX Open languages.

Note: This file is recreated each time you save your dialog. Once you modify the template code you should copy the working version to a new location to prevent your edits from being overwritten.

The template code will create a class using the name given to the DLX file. For example if the DLX file name is "testBlockDialog.dlx", the template code will create a class named "testBlockDialog" and the self-referencing object name will be "thetestBlockDialog".

What You Will Learn Here

The purpose of this section is to show how NX Open is used to interact at runtime with Block Styler dialogs. This section shows examples of how to modify the template code generated by the Block Styler for inclusion in your NX Open applications.

This section provides examples for the following topics:

  • Launching Block Styler Dialogs from NX — This topic shows the three different methods for loading and displaying a Block dialog from NX. It shows the standard entry points used to launch Block dialogs.
  • Block Styler Memory and Callbacks — This topic discusses the various callback methods that can be included in the template code. It discusses how the various callback methods are used to access dialog values and how dialog values interact with the underlying block objects (and further subtopics: Standard Navigator Buttons, Dialog Memory, Dialog Values, Callbacks, Dialog Value Example).
  • Dialog and Block Properties — covers reading/writing properties on individual blocks.
  • Block Styler Selection Blocks — covers selection-type blocks specifically.
  • Block Styler Update Callback — covers the update callback used for live dialog updates.

See also the sibling pages in this same section: blockstyler-launching-dialogs.md, blockstyler-memory-and-callbacks.md, blockstyler-dialog-and-block-properties.md, blockstyler-selection-blocks.md, blockstyler-update-callback.md.

Source: https://docs.sw.siemens.com/en-US/doc/209349590/PL20220512394070742.nxopen_prog_guide/block_styler · retrieved 2026-07-07