Find the right property models without mixing up their flags

When a molecular scene gets busy, a small search mistake can be surprisingly disruptive. You may be trying to locate a property model by name, check whether it is visible, or narrow your query to property model nodes—but similar-looking attributes can make it easy to reach for the wrong expression.

SAMSON’s Node Specification Language (NSL) gives property models their own attribute space: propertyModel, abbreviated pm. The key practical point is that pm matches only property model nodes. Starting with that prefix helps keep a query focused on the type of node you intend to inspect.

Start with the property model prefix

For example, the documented expression pm.n "A" uses the short name n for name. The attribute takes a string in quotes. The reference also shows pm.n "L*" as an example. If you are unsure how a particular string pattern is interpreted, check the NSL examples rather than assuming behavior from the punctuation alone.

Some property model attributes are Boolean: their possible values are true and false. The reference shows both a concise form and, for some attributes, a form with an explicit value. For instance, pm.h and not pm.h are examples for hidden; pm.v and not pm.v are examples for visible. These are separate attributes, so it is worth using the one that matches the question you are asking instead of treating the terms as interchangeable.

Keep the similar names straight

The reference lists several related attributes: hasMaterial (hm), ownsMaterial (om), hidden (h), and visible (v). They are all inherited from the general node attribute space, but their names are not synonyms. If you need to test one specific property, use its corresponding attribute rather than guessing based on another attribute’s name.

There is also an important naming detail for selection. Property models support selected, and the documented example is pm.selected (or not pm.selected). Unlike the general node attribute, this property-model version has no short name s. Use the full spelling instead of assuming that a shorthand available elsewhere applies here.

selectionFlag and visibilityFlag have their own short names, sf and vf. The reference gives examples such as pm.sf false and pm.vf false, as well as pm.sf and pm.vf. Because these are distinct attributes from selected and visible, choose the attribute named for the condition you want to test. When in doubt, consult the inherited node attribute documentation for the full definitions.

A quick query checklist

  • Are you searching property models specifically? Begin with pm.
  • Are you matching a name? Use pm.name or pm.n, followed by a quoted string.
  • Are you checking a Boolean property? Confirm whether you need hidden, visible, selected, a flag, or a material-related attribute.
  • Are you relying on a short name? Verify that the property model reference actually lists one; selected is the notable exception.

This simple check can save time when refining searches: first select the right node category, then choose the precise attribute, and finally verify the spelling or shorthand. For complete attribute details, see the property model attributes reference.

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

Comments are closed.