NXKnowledge

NX Open Programmer's Guide > Block Styler Automation > Block Styler Update Callback

Block Styler Update Callback

The Update callback is called anytime the user changes the value of any dialog block. By adding your own code to this callback you can customize the runtime behavior of your dialog. This page shows how to determine which block triggered the call to the Update callback and shows examples of how to access and set property values during the update callback. Other update examples can be found in Block Styler Selection Blocks.

The Update callback is an optional callback. Many dialogs simply collect values and options from a user and do not require the NX Open program to actively respond to specific user inputs. In these cases the Apply callback will simply access the current dialog property values to determine the desired actions.

Note: To reduce the amount of coding required to manage a dialog and to enforce consistent behavior throughout NX, many interactions between the user and a dialog are handled automatically by NX and do not generate calls to the Update callback.

Determining Which Block Called the Update Callback

The Update callback is passed a reference to the block that was changed and thus produced the update event. To determine which block caused the event, compare the block object passed as input to the Update callback against the block object references established in the Initialize callback (see Dialog and Block Properties for a discussion of block object references and FindBlock).

If an Update callback is requested when the dialog is saved, the template code for the Update callback will include an IF-THEN-ELSE block doing the necessary comparisons to determine which block caused the update event. To customize the dialog's actions, add your desired code to the branch within the IF-THEN-ELSE that matches the block whose behavior you are customizing.

Update Callback — Language Specific Details

The doc provides worked, language-specific (C++/.NET/Java) code examples of an Update callback customized to manage a small example dialog (a String block and related blocks whose values are kept in sync when the user edits one of them). The shape of the callback in every language is the same: an if/else if chain comparing the incoming block reference against each named block object (button01, blendOption, etc., as established via FindBlock in Initialize), with custom logic added in the matching branch.

Related Topics

  • Block Styler Automation
  • Block Styler Memory and Callbacks
  • Callbacks (Update)
  • Dialog and Block Properties
  • Block Styler Selection Blocks

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