Quickly Show or Hide Specific Visual Representations in SAMSON with NSL

If you spend a lot of time building, analyzing, or sharing molecular models in SAMSON, you’re probably used to toggling visual representations multiple times during a session. Whether you’re switching from a surface to a ribbon view, hiding a representation for clarity in screenshots, or locating all visible elements, managing visual clutter is a common challenge.

Fortunately, SAMSON’s Node Specification Language (NSL) provides a structured and rapid way to query and manipulate what’s shown in the viewport. This blog post focuses on a specific subset of NSL attributes: the presentation attributes for visibility and selection management. Getting familiar with these enables you to streamline your visual workflows and stay focused on meaningful data.

Why care about presentation nodes?

In SAMSON, many types of visual elements—including molecular surfaces, labels, volume renderings, etc.—are handled through presentation nodes. These are distinct from the data nodes they represent. If you want to target only what’s shown visually (not the underlying model), pr is the attribute space you need.

Control Visibility with Filters

Let’s say you have a complex scene and want to view only the visible representations. With NSL, that becomes this simple:

This selects all presentation nodes for which the visibility attribute is set to true.

Need the opposite—find all representations currently hidden? Just negate the query:

The helpful aspect here is that attribute access is reactive—you can make selections dynamically based on current scene states.

Toggling Flags for Fine Control

When precise control is required, NSL also lets you filter by how visibility and selection flags behave:

  • pr.vf: visibility flag
  • pr.sf: selection flag

For example, to only see the presentation nodes that are not affected by scene-wide visibility flags you could type:

Use Names as Filters

Trying to quickly grab all representations with a certain naming pattern? Use the pr.n attribute and wildcards:

This picks up all presentation nodes whose names start with “Surface”—a common naming convention for visual styles.

Quickly Isolate the Selected Representations

If you’ve just selected a molecule or a part of it and want to highlight its visual aspects, try:

This will return only the presentation nodes that correspond to selected elements in your workspace—useful for spotlighting the currently active dataset.

Wrap-up

The use of NSL’s presentation attributes is a small but powerful way to simplify molecular visualization in SAMSON. By learning just a few attribute names—like pr.v, pr.n, or pr.sf—you can create expressive filters to accelerate your modeling and reduce visual overload.

To learn more and explore the full list of presentation node attributes, visit the full documentation here: https://documentation.samson-connect.net/users/latest/nsl/presentation/

SAMSON and all SAMSON Extensions are free for non-commercial use. You can download SAMSON from https://www.samson-connect.net.

Comments are closed.