Molecular modelers often interact with complex datasets, and managing visibility, material properties, and selection states of nodes can be a daunting task. SAMSON’s Node Specification Language (NSL) helps simplify these processes. One standout feature within NSL is the use of property model attributes, essential for working specifically with property model nodes. Let’s explore how they can make your work more efficient.
Property model attributes are housed in the propertyModel attribute space, which can be conveniently shortened to pm. These attributes inherit behaviors from the node attribute space, making them powerful and versatile tools for streamlining node management during molecular modeling projects. Below, we’ll break down some of the most commonly used attributes and their applications in everyday modeling tasks:
1. Managing Visibility with visible and visibilityFlag
As molecular models grow in complexity, isolating specific components becomes crucial. The pm.v attribute (short for visible) determines whether a node is visible or hidden. To hide a node, use not pm.v. To complement this, pm.vf (short for visibilityFlag) allows for finer control over visibility states.
Practical example:
|
1 2 |
# Hide a specific property model node pm.v false |
2. Handling Material Associations
Working with specific materials is often critical in molecular modeling. The hasMaterial (hm) attribute lets you check whether a node is associated with a material, while ownsMaterial (om) is used to determine material ownership.
Example:
|
1 2 |
# Check if a node owns material pm.om |
Such clarity helps speed up workflows and ensures you don’t accidentally modify nodes without checking their material composition.
3. Simplifying Selection Processes
Selections are vital when applying changes to specific nodes. The pm.selected attribute allows for straightforward management of selection states. Note that while it’s inherited from the node attribute space, no short name (s) exists for this attribute within the property model scope. The selectionFlag (sf) attribute can further assist by toggling and locking selection states.
Example:
|
1 2 |
# Deselect a property model node pm.selected false |
4. Naming for Efficient Identification
When dealing with large-scale models, naming conventions can significantly reduce confusion. The name (n) attribute allows you to assign string identifiers to nodes for easy retrieval. Wildcard searches (using *) make navigating extensive datasets even more efficient.
Example:
|
1 2 |
# Select nodes with names starting with 'L' pm.n "L*" |
5. Combining Attributes for Precise Queries
Since NSL allows combining attributes flexibly, you can create precise queries tailored to specific molecular modeling needs. For example, finding nodes that are visible, selected, and own material becomes a seamless task with a combination of attributes:
|
1 2 |
# Find nodes that match multiple criteria pm.v true and pm.selected true and pm.om true |
Conclusion
The property model attributes in SAMSON’s NSL are indispensable tools for molecular modelers aiming to streamline their workflows. By leveraging these attributes—covering visibility, material associations, selection states, and more—you can manage complex node datasets with ease and precision.
To dive deeper into how property model attributes can enhance your projects, visit the original documentation page.
SAMSON and all SAMSON Extensions are free for non-commercial use. You can get SAMSON at samson-connect.net.
