Find the Note, Not the Noise: A Practical Guide to NSL Note Queries

In a busy molecular model, notes can be useful landmarks—but they can also become hard to distinguish from everything else in the scene. When you need to identify note nodes by name or narrow attention to notes with a particular visibility or selection state, the note attribute space in SAMSON’s Node Specification Language (NSL) gives you a focused way to describe what you’re looking for.

The key detail is the namespace: note attributes use the short name nt. An expression such as nt.n "A" refers to a note’s name, rather than asking for a matching name across every kind of node. That distinction can make a query easier to reason about when a model contains many different node types.

Start with the note namespace

Note attributes match only note nodes. The documented short forms include nt.h for hidden, nt.n for name, nt.sf for selectionFlag, nt.vf for visibilityFlag, and nt.v for visible. These attributes are inherited from the general node attribute space, so they are not unique to notes; the nt namespace is what makes the query note-specific.

For example, the expressions nt.n "A" and nt.n "L*" show how to write a name-based note query. Put the value in quotes, as shown in the reference. If you are unsure which name expression fits your task, begin with the exact name you can see in the model, then consult the NSL examples and attribute references for further syntax.

Check visibility without guessing

Two visibility-related attributes are listed: visible and visibilityFlag. Their short forms are v and vf. The reference gives nt.v and not nt.v as examples for testing visible state, and nt.vf false and nt.vf for the visibility flag.

These are separate attributes, so it is safer to query the one that matches the question you intend to ask rather than treating the terms as interchangeable. If you are diagnosing why a note is or is not showing as expected, inspect the relevant attribute explicitly. The note reference points to the node attribute documentation for the inherited definitions.

Selection state has two forms

The selected attribute can be tested with nt.selected or not nt.selected. For notes, this attribute does not have the short name s. The separate selectionFlag attribute does have the short name sf, with examples nt.sf and nt.sf false.

That distinction is useful when writing or reading someone else’s query: selected and selectionFlag are listed independently. Use the full attribute name when clarity matters, or the documented short form sf for the flag. Avoid assuming that a query for one automatically expresses the other.

A small, reliable workflow

  1. Begin with nt so you are targeting note nodes.

  2. Choose one attribute that directly represents your question: for example, name (n), visibility (v), or selection flag (sf).

  3. Use the documented value format. Names are written in quotes; Boolean states are written as true or false.

  4. Check the full attribute name if a short form is unclear—especially for selected, which has no short name in the note attribute list.

For quick reference, nt.h and not nt.h test hidden state; nt.v and not nt.v test visible state; and nt.selected and not nt.selected test selected state. These compact expressions can make note-focused queries easier to read and help prevent a broad node query from catching objects you did not intend to include.

For the complete attribute table and links to the inherited node definitions, see the SAMSON note attribute reference.

Note: SAMSON and all SAMSON Extensions are free for non-commercial use. Get SAMSON.

Comments are closed.