Understanding Label Attributes in SAMSON’s Node Specification Language (NSL)

For molecular modelers working with SAMSON, understanding how to effectively control and query nodes is crucial for enhancing workflows. The Label Attributes section of the Node Specification Language (NSL) offers tools to work more efficiently with label nodes, enabling detailed control over visibility, selection, naming, and more.

Label attributes are specific to label nodes, with their own attribute space (la). These attributes allow users to refine how labels are displayed and managed within their molecular models. Let’s explore some key aspects to help you solve common challenges faced during molecular modeling.

Controlling Visibility with the visible and visibilityFlag Attributes

One of the frequent tasks in molecular modeling involves managing the visibility of nodes to focus on specific aspects of a project. The visible attribute (v) in the label attribute space allows you to control whether a label is visible or hidden:

  • To query if a label is visible, use la.v.
  • To check if a label is not visible, use not la.v.

For more advanced visibility control, the visibilityFlag attribute (vf) can be used. It determines whether the visibility of the label is flagged as true or false. For instance:

  • la.vf or la.vf false to set or query the visibility flag.

These tools help streamline complex molecular models by adjusting their visual clarity.

Selection and Interactivity with selected and selectionFlag

Do you find it difficult to ensure labels are correctly selected, especially in larger models? The selected attribute enables you to query whether a label is currently selected:

  • la.selected to check if a label is selected.
  • not la.selected to check if it’s not selected.

While the short name s is not used here, the functionality remains simple and intuitive.

The selectionFlag attribute (sf) provides further power by checking or setting selection states programmatically. Example:

  • la.sf false to clear selection flags for labels.

Using these attributes, you can filter and interact with labels in your models without introducing errors or visual clutter.

Enhancing Workflow with Named Labels

The name attribute (n) lets you harness the power of named labels to organize your molecular models better. With this attribute, you can:

  • Query a specific label by name: la.n "Label1".
  • Use wildcards to match patterns, like la.n "L*" to query all labels starting with the letter L.

Named labels provide clarity, especially when models grow in complexity.

A Recap of Key Attributes

Here’s a quick summary of the most useful label attributes and their short names:

Attribute Name Short Name Example Usage
hidden h la.h, not la.h
name n la.n "A"
selected la.selected
selectionFlag sf la.sf false
visibilityFlag vf la.vf, la.vf false
visible v la.v, not la.v

By integrating these attributes into your workflow, you’ll unlock new ways to efficiently manage labels in your molecular models.

To explore these features further, visit the official documentation: Label Attributes – SAMSON.

Note: SAMSON and all SAMSON Extensions are free for non-commercial use. You can download SAMSON at https://www.samson-connect.net.

Comments are closed.