Using NSL to Control Note Visibility in SAMSON

As molecular models grow in size and complexity, modelers often turn to visual annotations—such as notes and labels—to document observations, mark points of interest, or organize a workspace. However, with many notes cluttering the screen, one common challenge emerges: how do you control when these notes appear or remain hidden based on context?

In SAMSON, this challenge is addressed through the Node Specification Language (NSL). NSL enables powerful filtering and querying of model components, and when it comes to notes, it includes a set of attributes that help personalize their visibility.

Why control note visibility?

Imagine you’re presenting your molecular design to a colleague, or preparing a figure for publication. You may only want to show certain annotations, or none of them at all. Manually toggling the visibility of each note node is inefficient. That’s where NSL comes in.

The nt.v attribute: Simple and useful

Using the visible attribute (short name: v) in the nt (note) attribute space gives you easy control over which notes are visible. You can write compact expressions to query or modify note visibility. Here are a few examples:

  • nt.v — selects all visible notes
  • not nt.v — selects all notes that are currently hidden
  • nt.vf false — selects notes with the visibility flag turned off (useful for precise control)

Once selected, you can choose to apply batch operations—like changing visibility, coloring, duplication, or deletion—to streamline your workflow.

Combining visibility with other attributes

The real power comes when you start combining the visible attribute with others, such as name (nt.n) or hidden (nt.h):

  • nt.v and nt.n "*Important*" — show only visible notes whose names include “Important”
  • not nt.v and nt.sf — find hidden notes that are selected

This allows for rapid toggling and cleanup, especially in large models with dozens of annotations.

A few distinctions to keep in mind

Note nodes inherit visibility behavior from the general node space, but there are a few specific elements in play:

  • visible refers to current visibility status (true or false)
  • visibilityFlag (vf) allows toggling the flag that controls visibility status
  • hidden (h) is another way to filter visibility, based on whether a node is intentionally hidden

These options provide flexibility depending on whether you want to query by visual state, or by user-defined flags.

Learning how to use NSL expressions like nt.v, nt.h, and nt.vf saves time and avoids visual clutter. This kind of visibility filtering is especially useful during simulations, presentations, or when exporting clean visuals.

To learn more about this topic—including how NSL applies to other types of nodes—visit the original documentation page.

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

Comments are closed.