For molecular modelers, efficiently handling and customizing the visualization of light-related nodes in molecular systems can be a significant challenge. The light attribute space in SAMSON’s Node Specification Language (NSL) offers a powerful solution to this problem. These attributes allow fine-tuned control over how light nodes are defined, managed, and customized in your projects, helping you improve clarity and focus on specific details within your models.
What Are Light Attributes?
The light attribute space (short name: li) is a dedicated subset of attributes that apply specifically to light nodes in your molecular design model. These attributes include names and flags that define visibility, selection, and more. They can be combined in logical expressions to selectively target light nodes, making your workflow much more efficient and reducing unnecessary manual steps.
Some of the most commonly used attributes include:
hidden(h): Determines whether a light node is hidden or not.name(n): Refers to the name of the light node, enabling targeted selection by name with regex-like capabilities.selected: Checks if the light node is selected or not.selectionFlag(sf): A logical flag for selection purposes.visibilityFlag(vf): Indicates whether the light node is set to be visible or not.visible(v): Determines whether a light node is visible in the model.
These attributes provide flexibility and precision in customizing your models, especially when interacting with large and complex molecular systems.
Practical Applications
Let’s now explore some concrete examples to showcase the power of light attributes:
1. Controlling Visibility
Suppose you only want to display light nodes that are visibly active in your model. The attribute li.v can help you achieve this:
|
1 |
li.v |
This expression filters and displays only nodes that are visible. You can also hide those light nodes selectively by using:
|
1 |
not li.v |
2. Filtering by Name
If your project involves multiple lights with descriptive names, you can filter them using the name (n) attribute:
|
1 |
li.n "A" |
This selects a light node named exactly “A.” If you want to filter by a pattern, such as nodes that start with “L,” use:
|
1 |
li.n "L*" |
3. Managing Hidden States
To ensure clarity and avoid distractions from unnecessary elements, use the hidden attribute (h) to select light nodes that are hidden:
|
1 |
li.h |
To reveal all hidden light nodes, you can invert the expression:
|
1 |
not li.h |
4. Combining Attributes for Greater Control
For advanced users, logical combinations of attributes enable complex queries. For instance, to find all visible and selected light nodes:
|
1 |
li.v and li.selected |
This approach is especially useful when managing large systems, allowing rapid adjustments without manual intervention.
Conclusion
The light attributes in SAMSON’s NSL are indispensable tools for molecular modelers striving for precision and clarity in their work. By mastering these attributes, you’ll simplify your workflow and focus on the elements that truly matter.
To deepen your understanding of light attributes and their capabilities, visit the full documentation at https://documentation.samson-connect.net/users/latest/nsl/light/.
SAMSON and all SAMSON Extensions are free for non-commercial use. You can download SAMSON and explore a world of molecular modeling at https://www.samson-connect.net.
