A common frustration in molecular modeling is finding that part of a structure seems to have disappeared. An atom may be hidden, selected, or locked for a reason that is not obvious from the atom itself. In SAMSON, the key detail is that a node’s effective state can depend on its ancestors in the data graph.
That distinction matters when you inspect a hierarchy. An atom can have its own visibility flag enabled and still be hidden because a parent node is hidden. The same inheritance applies to selection and locking. Node Specification Language (NSL) provides separate attributes for checking a node’s own flag and its effective state.
Check effective visibility first
Use node.visible (short form: n.v) to match nodes that are visible, including the condition that their ancestors are visible. To find nodes that are not visible, use node.visible false or not node.visible. For example, node.type atom identifies atoms, while node.visible false checks for nodes that are effectively hidden. These are useful starting points when you want to establish whether the problem affects atoms, a larger group, or both.
Then inspect the local flag with node.visibilityFlag (short form: n.vf). This attribute reports the node’s own visibility flag rather than whether the node is visible through the whole hierarchy. The documentation’s examples include node.visibilityFlag false and node.visibilityFlag true.
Comparing the two checks helps narrow down the cause:
- If a node is not visible and its visibility flag is false, its own flag is off.
- If a node is not visible but its visibility flag is true, an ancestor may have a false visibility flag.
- If the node and its ancestors are visible,
node.visiblematches it as visible.
This is a useful way to distinguish “this node was hidden” from “this node is inside something hidden,” without assuming the visible symptom identifies the cause.
Selection has the same local-versus-inherited distinction
Selection can behave similarly. node.selected (or n.s) matches nodes that are selected because their own selection flag is true or because an ancestor’s selection flag is true. By contrast, node.selectionFlag (or n.sf) checks the node’s own flag.
For example, use node.selected to look for effectively selected nodes and node.selectionFlag false to inspect nodes whose own selection flag is off. A selected child with a false local flag may be inheriting selection from a parent. Keeping these two checks separate makes it easier to understand why a selection appears broader than expected.
Locked state follows the same pattern
node.locked (short form: n.l) matches nodes that are locked either directly or because an ancestor is locked. node.lockedFlag (short form: n.lf) checks the node’s own locked flag. When a node seems unexpectedly locked, compare effective state with the local flag to determine whether to inspect its place in the hierarchy.
A practical troubleshooting habit
When an element looks hidden, selected, or locked unexpectedly, check the effective attribute first, then check its corresponding flag attribute. Repeat the flag check higher in the hierarchy if the local flag does not explain the effective state. This approach turns a visual mystery into a specific question: is the state set here, or inherited from above?
The same node-level attribute space also includes names, types, categories, and material properties, so these checks can be combined with the kind of node you are investigating. For example, node.type atom narrows attention to atoms, and node.name "A" matches nodes named A. For the full list of node attributes and examples, see the SAMSON node attributes reference.
Note: SAMSON and all SAMSON Extensions are free for non-commercial use. Get SAMSON.
