The Flag Is True—So Why Is This Node Hidden?

A molecular model can be hard to troubleshoot when a node’s own setting does not explain what you see. An atom may have its visibility flag set to true and still be hidden because a parent node is hidden. Selection and locking can behave similarly: an ancestor’s state can affect its descendants.

In SAMSON, the Node Specification Language (NSL) distinguishes between a node’s direct flag and its effective state in the hierarchy. That distinction is useful when you need to find what is actually visible, selected, or locked—or track down why a node is not.

Direct flags versus effective state

A flag describes the setting on the node itself. For visibility, query that setting with:

node.visibilityFlag true (short form: n.vf true)

The visible attribute asks a broader question: is the node visible, considering both its own visibility flag and those of its ancestors?

node.visible (short form: n.v)

That difference matters when diagnosing a hierarchy. A query for node.visibilityFlag true can match a node whose own flag is on, even if an ancestor makes the node effectively hidden. To search for nodes that are actually hidden in the hierarchy, use not node.visible (short form: not n.v).

A practical visibility check

When a region of a model seems to be missing, try thinking in two steps:

  1. Check the effective state: node.visible finds nodes that are visible, while not node.visible finds nodes that are not.

  2. Check the direct setting: node.visibilityFlag false finds nodes whose own visibility flag is off.

If a node is hidden but its own visibility flag is true, the distinction points you toward the hierarchy: an ancestor may have its visibility flag turned off. NSL queries help separate “this node is switched off” from “this node is hidden because of its place in the tree.”

The same idea applies to selection and locking

node.selected (n.s) matches nodes that are selected either because their own selection flag is true or because an ancestor’s flag is true. By contrast, node.selectionFlag true (n.sf true) checks the flag on the node itself. So not node.selected asks whether a node is effectively unselected, while node.selectionFlag false asks whether its own flag is off.

Locking follows the same pattern. node.locked (n.l) includes nodes locked by their own flag or an ancestor’s. node.lockedFlag true (n.lf true) checks the node’s direct flag. If a node appears locked, comparing these queries can help distinguish a local setting from an inherited one.

A small mental model that saves time

When querying hierarchical state, ask two questions: “What is this node’s flag?” and “What is this node’s effective state?” In NSL, the attributes ending in Flag answer the first question; attributes such as visible, selected, and locked account for ancestors as well. Keeping those questions separate makes search results easier to interpret and avoids chasing the wrong node.

For the full node-attribute reference and more examples, see the SAMSON NSL node attributes documentation.

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

Comments are closed.