When the Scene Gets Busy: A Quick Guide to Presentation Attributes

In a molecular scene, it is easy to lose track of what is currently visible, hidden, or selected. A model may contain many presentation nodes, and searching by name alone does not answer questions like “Which presentations are hidden?” or “Which ones are selected?” SAMSON’s Node Specification Language (NSL) provides a small set of presentation attributes that can help you describe these states.

This guide focuses on the presentation attribute space, whose short name is pr. The key practical point is that pr matches only presentation nodes. If your search is intended to concern presentations rather than every kind of node, using this attribute space makes that intent explicit.

Start with the state you want to inspect

The presentation attributes include hidden, visible, selected, selectionFlag, and visibilityFlag. They accept Boolean values, and the reference page gives convenient short forms for several of them:

  • pr.h refers to hidden; not pr.h expresses the opposite condition.
  • pr.v refers to visible; not pr.v expresses the opposite condition.
  • pr.sf refers to selectionFlag, and pr.vf refers to visibilityFlag.
  • pr.selected checks the selected attribute. Unlike the node attribute, it has no short name in the presentation attribute space.

For example, if you want to focus your query on hidden presentations, pr.h is a compact expression to try. If you instead want the presentations that are not hidden, use not pr.h. Similarly, pr.v and not pr.v let you express conditions using the visible attribute. These paired forms are handy when you need to inspect either side of a state rather than repeatedly rewriting a longer query.

Don’t confuse similar-looking attributes

The list contains both selected and selectionFlag, as well as visible and visibilityFlag. Their names are similar, but the documentation lists them as separate attributes. Use the exact attribute that matches the question you are asking; for instance, the documented forms are pr.selected for selected and pr.sf for selectionFlag. The reference identifies these attributes and their possible Boolean values, but does not define further differences in their behavior, so avoid assuming they are interchangeable.

Use names when state is not enough

Presentation nodes also inherit the name attribute from the node attribute space. You can refer to it using pr.n. The documentation shows these examples:

  • pr.n "A"
  • pr.n "L*"

These examples demonstrate how a quoted name can be included in a presentation query. They are useful reminders that you can inspect presentations by identity as well as by state. The reference does not specify the matching rules for the asterisk in "L*", so treat it as a documented example rather than assuming a particular wildcard behavior.

A simple way to choose an attribute

Before writing an expression, translate the task into one of the attribute names: “hidden” points to pr.h; “visible” points to pr.v; “selected” points to pr.selected; and the flag attributes point to pr.sf or pr.vf. Use not when you need the opposite of a Boolean condition, as shown in the reference examples. If the task is about a named presentation, use pr.n with a quoted string.

This small habit—choosing the attribute that matches the question before composing a query—can make searches easier to read and less prone to mixing up visibility, selection, and their corresponding flags. For the full attribute list and links to the inherited node definitions, see the presentation attributes reference.

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

Comments are closed.