SAMSON Python API overview#
Use this page as a bridge between task-oriented guides and the generated Python API reference. Start from the guides when you want a workflow; use the API pages when you need exact classes, functions, properties, and signatures.
Common API entry points#
API |
Use for |
Related guide |
|---|---|---|
Triggering SAMSON commands and actions by name. |
||
Retrieving nodes from the active document with NSL. |
||
Accessing the active document before inspecting or modifying nodes. |
||
Accessing and adjusting the active camera. |
||
Making document changes undoable. |
||
Working with node collections returned by NSL queries and selection APIs. |
||
Understanding shared node behavior such as names, flags, parents, children, and lifecycle. |
||
Managing document contents and selected nodes. |
||
Creating or organizing structural nodes. |
||
Creating, inspecting, selecting, or editing atoms. |
||
Creating or processing bonds between atoms. |
||
Assigning colors and working with RGBA values. |
||
Creating physical quantities with units. |
Choosing an entry point#
Goal |
Start with |
Notes |
|---|---|---|
Run an operation available in the SAMSON interface |
Commands are UI actions and depend on command names. |
|
Find atoms, residues, molecules, paths, or other nodes |
Use NSL when you need nodes for further processing. |
|
Change selection state directly |
Wrap direct selection changes in |
|
Add new nodes to the active document |
Create nodes, hold them for undo, and add them to a valid parent. |
|
Work with lengths, positions, energies, or times |
Prefer quantity constructors such as |
API reference map#
SAMSON contains the high-level
SAMSONfunctions used in most scripts.SBNode and SBNodeIndexer cover common node and node-collection behavior.
SBDocument and SBCamera cover documents and cameras.
SBStructuralModel, SBAtom, SBBond, SBMolecule, and SBResidue cover molecular structures.
SBQuantity covers physical units and quantities.
SBColor and SBPhysicalVector3 cover colors and physical vectors.