Labels are a helpful way to annotate and organize structures in molecular modeling projects. But when your scene gets crowded with dozens of them, manual hiding or showing becomes inefficient—especially when you want to highlight just a specific subset.
Fortunately, the Node Specification Language (NSL) in SAMSON offers a convenient way to control label visibility with a structured and flexible syntax.
Why visibility control matters
If you’re modeling a large system, manipulating labels one at a time can take a lot of clicks. Maybe you’re comparing different annotations, staging images for publication, or preparing an animation. In all cases, it’s helpful to quickly hide all labels except those matching certain names or properties.
Instead of digging through the interface to toggle labels, you can use NSL queries like:
|
1 |
la.v |
This matches all label nodes that are currently visible. Similarly, not la.v selects those that are invisible.
Understand the syntax
The label attributes live in the la (short for label) attribute space. Among these, the visibility-related ones are:
la.v— visiblela.vf— visibility flag
Both accept values true or false. For example, you can select all invisible labels using one of the following:
|
1 2 |
not la.v la.v false |
Once selected, you can toggle visibility for all at once using SAMSON’s inspector or visualization tools.
Combine with name filters
Want to show or hide labels with a specific name pattern? Combine visibility with name queries using:
|
1 |
la.n "L*" and not la.v |
This selects all invisible labels whose name begins with “L”—making them easier to display by batch.
Conversely, the following selects all labels starting with “A” that are visible:
|
1 |
la.n "A*" and la.v |
Example workflow
- Open your molecular model in SAMSON.
- Use the NSL Filter panel to enter your visibility query (e.g.,
not la.v). - Labels matching the query are selected immediately.
- Use the label inspector or right-click to toggle visibility.
This approach gives you full control over what you see—without clutter or manual mousework.
To learn more about available label attributes and visibility controls in NSL, please visit the original documentation page.
SAMSON and all SAMSON Extensions are free for non-commercial use. You can download SAMSON here.
