A small NSL guide to finding property models in a busy scene

When a molecular scene gets crowded, the hard part is often not building another model—it is finding the particular property model you need among the nodes already present. SAMSON’s Node Specification Language (NSL) offers a focused way to describe property model nodes using their names and state attributes. This can make a cleanup or inspection task more deliberate: write a precise expression, then use it to identify the nodes that match.

The key detail is the attribute space. Property model attributes live in propertyModel, with the short prefix pm. The documentation says this attribute space matches only property model nodes. So pm is not just decoration: it keeps the query scoped to that node type.

Start with a name when you know what you are looking for

Property models inherit the name attribute from the general node attribute space. Names are written as strings in quotes. The reference gives pm.n "A" and pm.n "L*" as examples; the short form for name is n.

If you are trying to locate one named model, beginning with a name-based expression can be easier to reason about than starting with several state flags. Keep the quotes around the string. The reference shows these forms but does not define the matching rules for special characters such as *, so treat "L*" as a documented example rather than assuming a particular wildcard behavior.

Use Boolean attributes to inspect state

Several inherited attributes take true or false. For example, pm.v tests the visible attribute, while not pm.v expresses its opposite. The short name for visible is v. Similarly, pm.h and not pm.h query hidden.

These are separate attributes in the reference, so it is useful to keep their names straight rather than treating them as interchangeable. The page lists both visible and hidden, but does not explain how their values relate in every situation. When diagnosing a scene, query the attribute that matches the question you actually have.

For selection-related checks, the full form is pm.selected or not pm.selected. Unlike most attributes in this list, selected has no short name in the property model attribute space; the page specifically notes that it does not use the node-level short name s. For the related selectionFlag attribute, the short name is sf, and the reference shows both pm.sf and pm.sf false.

Keep material checks precise

The inherited material attributes are hasMaterial (hm) and ownsMaterial (om). Their examples are pm.hm and pm.om; both attributes accept Boolean values. The distinction in their names is a useful reminder to ask the specific question you mean—whether a property model has material, or whether it owns material—instead of relying on a vague “material-related” search.

The same pattern applies to visibilityFlag (vf): the reference shows pm.vf and pm.vf false. Bare Boolean examples and explicit false examples are both useful to recognize when reading NSL expressions. If you are unsure which state you need to inspect, begin with one attribute at a time and use the full attribute names as a guide.

A quick checklist

  • Use pm to scope the expression to property model nodes.
  • Use pm.n "..." when identifying a model by name.
  • Use not with Boolean attributes when looking for the opposite state, as shown for visible, hidden, and selected.
  • Remember that selected has no short form here; use pm.selected, not pm.s.
  • Check the attribute list before shortening an expression: v, h, hm, om, sf, and vf are listed short names.

The expressions above are deliberately small. They help isolate what you are asking about—name, visibility, selection, or material—without assuming extra syntax or behavior. For the full attribute reference and its examples, see the property model attributes documentation.

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

Comments are closed.