When working with complex molecular models, especially those involving large assemblies or systems with extensive annotations, being able to quickly identify and isolate visible notes can greatly improve efficiency and clarity. Notes might be used to store hypotheses, instructions, or contextual information, but as models scale, visual clutter becomes a challenge.
Luckily, SAMSON’s Node Specification Language (NSL) provides a clean way to query and manage note visibility through attributes in the nt (note) attribute space. This helps molecular modelers quickly filter and interact only with the relevant visible (or invisible) notes in a scene.
Why filter by visibility?
Imagine you’re sharing a complex structure with collaborators and want to highlight only a few key annotations during a presentation—or perhaps you’re preparing figures and need to make sure hidden notes don’t interfere with your view or selection. In such situations, being able to programmatically access note nodes based on their visibility is extremely helpful.
The visible and hidden attributes
There are two useful attributes to control or filter based on the visual state of notes:
nt.v— the visible attribute; returns true if the note is visible.nt.h— the hidden attribute; returns true if the note is hidden.
To get all visible notes in your molecular model, use the NSL query:
|
1 |
nt.v |
To get all hidden notes, use:
|
1 |
nt.h |
Combining queries for more power
You can combine visibility attributes with other note properties like name or selection. For instance:
|
1 |
nt.v and nt.n "Analysis*" |
This line selects visible notes that have names starting with “Analysis”—perfect for focusing on annotations relevant to your current task.
Similarly:
|
1 |
not nt.v |
returns all hidden notes, providing a quick overview of temporary or private annotations you might have previously suppressed.
Quick visibility toggling
Though NSL itself is for querying, once notes are filtered in the Document View using such expressions, they can easily be toggled via standard SAMSON GUI actions. This enables a fast workflow: filter, select, and toggle visibility—all within a few seconds.
Note that SAMSON also includes related visibility attributes at the flag level:
nt.vf— visibilityFlag, to filter based on visibility override flags.
These might be useful for more fine-grained control in hierarchical structures or automation scripts.
Conclusion
Don’t let annotations overwhelm your view. With just a few NSL expressions like nt.v or not nt.v, you can regain control of your scene and keep your research focused. It’s a small trick that quickly becomes a habit for experienced SAMSON users.
To learn more, visit the full documentation page here: https://documentation.samson-connect.net/users/latest/nsl/note/.
SAMSON and all SAMSON Extensions are free for non-commercial use. You can get SAMSON at https://www.samson-connect.net.
