A safer way to find property models in a crowded scene

When a molecular scene contains many kinds of nodes, a search can become frustrating if it matches more than the objects you meant to inspect. Property models have their own Node Specification Language (NSL) attribute space: propertyModel, shortened to pm. That gives you a clear starting point for queries that should match property model nodes specifically.

Start with the node type

Use the pm prefix before an attribute to express that your query concerns property models. For example, pm.h checks the inherited hidden attribute, while pm.v checks visible. The key practical detail is that the propertyModel attribute space matches only property model nodes. This helps keep a query focused on the right kind of object instead of relying on a name or visual appearance alone.

Use names when you need a recognizable target

Property models inherit the node name attribute. Its short name is n, and values are written in quotes. The reference gives examples such as pm.n "A" and pm.n "L*". If you are checking a model by name, quoting the value makes the intended string explicit. The example with an asterisk is useful to keep in mind when reading or writing name-based expressions; consult the NSL examples for broader syntax guidance rather than assuming a particular matching rule.

Visibility and selection are separate checks

The property model attribute list includes hidden, visible, visibilityFlag, selected, and selectionFlag. They are listed as distinct attributes, so use the one that corresponds to the question you are asking. For example, the documented expressions include pm.v and not pm.v for visibility, and pm.selected and not pm.selected for selection. The flags can also be written with explicit boolean values, as in pm.vf false or pm.sf false.

One easy-to-miss detail: although selected is inherited from the node attribute space, it does not have the short name s in the property model space. Use pm.selected rather than assuming that every inherited attribute keeps a short form in this context.

Check material-related properties too

Two more inherited attributes describe material-related properties: hasMaterial (short name hm) and ownsMaterial (short name om). Their examples include pm.hm and pm.om; both accept true or false values. These can help you distinguish property models according to the material-related condition you need to inspect, without making the model’s name carry all the information.

A small, repeatable query habit

When a result surprises you, break the expression into simple checks: first make sure you are using the pm attribute space, then verify the attribute name, and finally check whether the expression asks for true or false. For visibility and selection, try the positive and negated examples separately before building a more complex expression. This makes it easier to spot whether the issue is the node type, the attribute, or the value being tested.

The full reference lists the available property model attributes, their short names, possible values, and examples. Read the property model NSL reference to learn more.

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

Comments are closed.