When working with large molecular systems, it’s easy for the workspace to become visually cluttered. Especially when label nodes—used for annotating or identifying parts of a system—are scattered across complex models. Finding which labels are visible, filtering out those that are not, or identifying mislabeled selections can be time-consuming without the right tools.
Fortunately, SAMSON’s Node Specification Language (NSL) provides a way to query label visibility with precision, saving time and minimizing frustration. If you’re frequently jumping between hidden, selected, or named labels, this deep dive into label attributes in NSL might be just what you need.
Working with the label Attribute Space
Labels in SAMSON are nodes too, but they live in a specific attribute space: label (or la for short). This space gives you access to attributes that let you filter labels based on their visibility, selection, and naming status. Here’s a quick overview of the key attributes related to visibility:
| Attribute | Short Name | Description | Example |
|---|---|---|---|
hidden |
h |
True if the label is hidden | la.h |
visible |
v |
True if the label is visible | la.v |
visibilityFlag |
vf |
Shows or sets the visibility flag | la.vf |
What Causes Model Clutter?
Some common pain points for molecular modelers include:
- Labels that remain visible long after they’re needed
- Difficulty tracking which labels are suppressing visibility when combined with other GUI settings
- Forgetting which node is named or selected
By learning just a few NSL expressions, you can quickly search for or hide these nodes:
- To find only visible labels:
la.v - To find hidden labels:
la.hornot la.v - To isolate unselected but visible labels:
la.v and not la.selected
Use Case: Cleaning Up for Rendering
Before rendering your scene for publication or presentation, it may be helpful to find only the labels currently shown on screen:
|
1 |
la.v |
This lets you isolate visible labels, so you can check text accuracy, styling, or hide them if necessary. Conversely, you may want to hide all labels first, and then selectively show just the ones you need:
|
1 |
not la.visible |
This approach gives you full control over what gets rendered—no more random labels appearing during screenshot export or animations.
Helpful Bonus: Using Short Names
While most attribute queries can be run with full names like la.visible, using short names can simplify your workflow. For instance:
la.hinstead ofla.hiddenla.sfforselectionFlagla.vfforvisibilityFlag
If you find yourself writing queries often, the shorthand versions can add up to substantial time savings.
All label attributes listed here are inherited from the general node attributes in NSL, but are scoped specifically to label nodes, ensuring queries are more precise within complex systems.
This sort of visibility management becomes especially helpful in workflows involving custom scripting, recordable actions, or when designing for collaboration—where clarity matters.
To learn more about available label attributes and how to combine them, consult the full documentation page here: https://documentation.samson-connect.net/users/latest/nsl/label/
SAMSON and all SAMSON Extensions are free for non-commercial use. To get started, visit https://www.samson-connect.net.
