When working on complex molecular systems in SAMSON, especially those involving extensive hierarchies of data structures and visual elements, it’s easy to get lost among numerous nodes. You may find yourself asking: Which nodes are currently selected?, or Which property models are hidden from view?
With the Node Specification Language (NSL) and its propertyModel attribute space, you can answer these questions quickly and precisely, making your workflows more efficient. In this post, we’ll look specifically at how to identify selected, hidden, and visible property models using NSL filters.
Why this matters
Property model nodes often store information associated with other nodes (like atoms or molecules) and can be used to represent selections, annotations, or computed properties. But navigating hundreds of property models becomes impractical without the ability to filter based on visibility, selection status, or material ownership. That’s where NSL attributes like pm.selected, pm.h (for hidden), and pm.v (for visible) come in very handy.
Basic filters
NSL makes attribute-based filtering straightforward. Here are a few practical examples:
- Find all selected property models:
pm.selected - Find all unselected property models:
not pm.selected - Find all hidden property models:
pm.h - Find all visible property models:
pm.v
Note that while regular nodes use the short name s for selected, property models do not—so always use selected directly with the pm prefix.
Combining filters for more control
You can also craft combined expressions to further refine data in the viewport or other downstream tools:
- Show all visible and selected property models:
pm.v and pm.selected - Identify hidden property models that are still part of the current selection:
pm.h and pm.selected
Use cases
These filters are useful when:
- Debugging scripts or visualizations that assign property models conditionally
- Cleaning a scene by hiding or removing certain data annotations
- Reviewing data extracted from simulations where property models are used to store dynamics, constraints, or other metadata
Using short names
To speed up your workflow, remember the short name mappings for boolean attributes related to visibility and selection:
| Attribute | Short name | Example |
|---|---|---|
| hidden | h |
pm.h |
| visible | v |
pm.v |
| selectionFlag | sf |
pm.sf |
| visibilityFlag | vf |
pm.vf |
All these filters can be written in the Search bar in SAMSON or used in scripts that rely on node queries.
If you’re often wondering why certain data isn’t showing or what exactly is part of your current selection, these few lines of NSL can help you find precise answers fast.
To learn more, visit the full documentation for NSL property model attributes.
SAMSON and all SAMSON Extensions are free for non-commercial use. You can download SAMSON here.
