NXKnowledge

NX Open Programmer's Guide > Block Styler Automation > Block Styler Selection Blocks

Block Styler Selection Blocks

Selection blocks define a consistent set of Block Styler Blocks that are used to enable interactive selection of many different kinds of common NX objects. The blocks simplify the selection process by providing predefined filters for common NX objects and consistent selection behavior. For instance, blocks exist to specifically select Faces, Curves/Edges, Features, Blend Faces, or any general NX object. Common behaviors include the management of multiple selection lists, pre-selection, unselect, selection highlighting/unhighlighting, selection intent, object filtering, management of the Apply button for required object selections, interaction with the Model Navigator, and access to the quick pick tool to resolve ambiguous selections.

Although many of the behaviors are provided automatically by the selection blocks, you are still able to programmatically refine the selection filter and to manage the selection list. This section discusses the common methods used to work with selection blocks from NX Open code.

Selection List

Each selection block maintains its own selection list. To access the selection list, use the same property-list methods discussed in Dialog and Block Properties. The common property name for all selection blocks is "SelectedObjects", and the property type is a TaggedObjectVector.

To obtain the list of currently selected objects for a given selection block:

<list of selected objects> = propertyList.GetTaggedObjectVector("SelectedObjects")

As with other properties, use the corresponding Set method to programmatically set the currently selected objects for a given block:

propertyList.SetTaggedObjectVector("SelectedObjects", <list of selected objects>)

To clear the selected objects, pass in an empty list to the Set method.

Note: The "SelectedObjects" property will not be seen in the Block Styler properties window because the value cannot be set at dialog design time.

Filter Callback

Optionally you can have the Block Styler generate a selection filter callback. This callback permits you to filter out objects that you do not want selection intent to pre-highlight.

The selection filter callback receives:

  1. The block reference for the selection block currently being used by the user.
  2. A reference to the specific NX object being considered for pre-selection highlighting.

Use the selection block reference to branch to the code handling filtering for your different selection blocks. Use the NX object to determine whether the user should be able to select that specific object. Any object rejected by your selection filter callback will not pre-highlight for selection and cannot be selected by the user.

Other Selection Filters

It is also possible to set the same selection filters that are available using the interactive Selection Filter dialog, programmatically, on a selection block (in addition to / instead of writing a Filter callback).

Related Topics

  • Block Styler Automation
  • Block Styler Memory and Callbacks
  • Dialog and Block Properties
  • Block Styler Update Callback

Note on depth

This source page (block_styler_selection) is very long (~55,000 characters) and contains extensive per-language (C++/.NET/Java) worked code examples for multiple selection blocks used together on one dialog, including full Filter-callback and Apply-callback bodies. This file captures the conceptual model and the SelectedObjects/TaggedObjectVector API surface and the Filter-callback contract verbatim from the source; the full multi-block worked example was not transcribed in exhaustive line-by-line detail due to its length, but no class/method name here was invented — every identifier above (SelectedObjects, TaggedObjectVector, GetTaggedObjectVector, SetTaggedObjectVector) is taken directly from the source text.

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