When a Molecular Scene Looks Wrong: Read Presentation State Before You Filter

A molecular scene can be confusing for a simple reason: a node may exist in the document but not be visible, may be marked as selected, or may have a name that is easy to overlook. When you need to find presentation nodes by these properties, SAMSON’s Node Specification Language (NSL) provides a compact way to describe what you’re looking for.

The key is to treat presentation attributes as separate clues rather than interchangeable labels. The presentation attribute space, abbreviated pr, matches only presentation nodes. Its attributes include names, visibility-related values, and selection-related values. This gives you a focused starting point when your task concerns how nodes are presented in a scene.

Start with a specific question

Instead of searching broadly, decide which property matters. For example, are you checking whether a presentation node is visible? Looking for nodes marked as selected? Or trying to identify a node by its name? Keeping these questions separate makes an NSL expression easier to read and helps avoid mixing up attributes that sound similar.

  • Visibility: pr.v refers to visible; not pr.v expresses the opposite condition.
  • Selection: pr.selected checks the selected attribute; not pr.selected checks for its opposite.
  • Name: pr.n "A" uses the short name for name, with the value written in quotes. The documentation also shows pr.n "L*" as an example.
  • Hidden state: pr.h and not pr.h refer to the hidden attribute.

Don’t conflate similar attributes

Two pairs deserve particular care: selected and selectionFlag, and visible and visibilityFlag. They are listed as distinct attributes. The documentation gives pr.selected and pr.sf as separate ways to refer to selection-related properties, and pr.v and pr.vf as separate ways to refer to visibility-related properties. The short names are sf for selectionFlag and vf for visibilityFlag.

That distinction matters when you are diagnosing a scene. If a query based on pr.v is not the property you intended to inspect, don’t silently substitute pr.vf just because both names mention visibility. Choose the attribute that matches your question, and consult the relevant NSL reference if you need to understand the attribute’s detailed behavior. The same principle applies to pr.selected and pr.sf.

Use short names carefully

Short names can make expressions concise: pr.h means hidden, pr.n means name, pr.sf means selectionFlag, pr.vf means visibilityFlag, and pr.v means visible. One exception is worth remembering: selected has no short name in the presentation attribute space. Write pr.selected, not an assumed abbreviation.

The prefix also helps make an expression self-explanatory. When you see pr, you know the attribute is being considered in the presentation attribute space, which matches presentation nodes. That context can make a saved expression easier to review later, especially when you return to a complex molecular scene after time away.

A quick check before you search

  1. Identify the kind of node you want to match: this attribute space is for presentation nodes.
  2. Choose one property to inspect, such as visible, selected, or name.
  3. Use the documented spelling or short name, and quote name values.
  4. For boolean attributes, use the positive or negated form shown in the reference.
  5. Keep similarly named attributes distinct until you have confirmed which one answers your question.

This small habit can save time when a scene feels inconsistent: first clarify whether you mean a node’s visibility, its visibility flag, its selected state, or its selection flag. Then express that specific condition rather than guessing from the scene alone.

For the complete attribute table and examples, see the SAMSON presentation attributes reference.

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

Comments are closed.