Find the Right Property Models Without Losing Your Place

A crowded molecular scene can make a small task surprisingly fiddly: you want to find property model nodes with a particular state, but you don’t want to confuse them with other node types or rely on what happens to be visible on screen. SAMSON’s Node Specification Language (NSL) provides a focused way to describe property models and inspect attributes such as name, visibility, and selection.

The key starting point is the propertyModel attribute space. Its short name is pm, and it matches only property model nodes. That scope matters: a query beginning with pm is specifically about property models, rather than every node in the document.

Start with a focused scope

Use the short prefix in the documented examples:

This expression refers to property models whose visible attribute is true. To target those whose visible attribute is false, use the documented negated form:

The same pattern is available for the hidden attribute:

These are useful when you need to check a state directly rather than infer it from a visual impression of the scene. The important practical habit is to keep the attribute name in mind: visible and hidden are separate attributes, so choose the one that matches the question you are asking.

Use names to narrow the search

Property models inherit the node name attribute. Name values are written in quotes, as in these documented examples:

This gives you a way to describe a property model by name instead of relying only on its state. If your scene contains many models, a name-based expression can be a useful first filter before you inspect visibility or selection-related attributes. The examples show both an exact-looking name and a name containing an asterisk; consult the NSL reference for the language’s full matching rules before depending on a particular pattern behavior.

Be precise about selection attributes

The property model attribute list includes both selected and selectionFlag. For property models, selected has no short name, so write it in full:

selectionFlag, by contrast, has the short name sf:

Because the reference lists these as distinct attributes, don’t substitute one for the other just because both sound selection-related. Use the attribute that corresponds to the state you need to query. The same care applies to visible (v) and visibilityFlag (vf): both are available, but they are separately named in the attribute space.

A quick reference for property model queries

  • pm scopes a query to property model nodes.
  • pm.n "A" checks the inherited name attribute using a quoted value.
  • pm.v and not pm.v express the two boolean cases for visible.
  • pm.selected uses the full attribute name; this attribute has no short name in the property model space.
  • pm.sf and pm.vf are short forms for selectionFlag and visibilityFlag.

When a query does not behave as expected, check three things: that you used the pm scope, that the attribute is the one you intended, and that boolean or name values follow the documented form. For the complete attribute list and additional NSL context, see the property model attributes reference.

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

Comments are closed.