Find the Right Presentation Nodes Without Losing Track of What You’re Filtering

When a molecular scene contains many presentation nodes, it can be difficult to narrow the view to the items you want to inspect. A useful first step is to describe the target with a Node Specification Language (NSL) expression instead of relying on a long sequence of manual selections. The presentation attribute space is designed for this: it matches presentation nodes and lets you query properties such as name, visibility, and selection state.

Presentation attributes use the prefix pr. For example, the expression pr.v refers to the visible attribute. The full and short forms make expressions easier to read or type, while keeping the attribute space explicit.

Start with a single question

Before writing a query, decide what you need to find. Are you looking for visible presentations, hidden ones, a particular name, or nodes marked as selected? Keeping the query focused helps avoid mixing separate kinds of state.

  • pr.v matches presentations whose visible attribute is true.
  • not pr.v matches presentations whose visible attribute is false.
  • pr.h and not pr.h query the hidden attribute.
  • pr.selected and not pr.selected query the selected attribute.

These expressions are useful when you want to focus a search on one state at a time. For example, if you are checking which presentation nodes are currently visible, begin with pr.v. If you instead want the opposite set, use not pr.v. Negation gives you a direct way to express the complement without changing the attribute.

Keep similar attributes distinct

The reference lists both visible and visibilityFlag, as well as both selected and selectionFlag. They are distinct attributes, so use the name that matches the property you intend to query rather than treating the pairs as synonyms. Their short forms are v for visible, vf for visibilityFlag, and sf for selectionFlag. The selected attribute has no short name in the presentation attribute space.

For example, these are different queries:

The documentation identifies each as a Boolean attribute, so the expressions can also explicitly test for false with values such as pr.vf false or pr.sf false. This is handy when you want the condition to be visible in the query itself rather than relying on a negated form.

Use names to narrow the target

When state alone returns too many candidates, add a name condition. The name attribute accepts strings in quotes, and its short name is n. The documented examples include pr.n "A" and pr.n "L*". Quoting the value makes the string boundary clear and helps keep the expression readable.

These examples can be useful as starting points when searching for a presentation by name or combining a name check with a state check. Build the expression in small steps: test the name first, then add a visibility or selection condition if needed. That makes it easier to spot which part of a query is responsible for narrowing the results.

A small reference for everyday queries

Presentation attributes are inherited from the node attribute space. If an expression behaves differently from what you expect, check whether you chose the intended attribute—especially when distinguishing visibility from hidden state, or selected state from a selection flag. The names and short forms are compact, but their differences matter when you are trying to make a precise query.

For the complete list of presentation attributes and examples, see the Presentation attributes reference.

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

Comments are closed.